MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / execute

Method execute

src/codegraph/tools.ts:84–100  ·  view source on GitHub ↗
(args: z.infer<typeof SearchArgs>, ctx: ToolContext)

Source from the content-addressed store, hash-verified

82 argsSchema = SearchArgs;
83
84 async execute(args: z.infer<typeof SearchArgs>, ctx: ToolContext): Promise<ToolResult> {
85 const db = requireDB();
86 if ('error' in db) return { content: db.error, isError: true };
87
88 const rows = db.searchSymbolsByPrefix(args.prefix, args.kind, args.limit ?? 50);
89 if (rows.length === 0) {
90 return { content: `[NO_MATCHES] No symbols starting with "${args.prefix}"`, isError: false };
91 }
92 const lines = rows.map(r => {
93 const rel = path.relative(ctx.cwd, r.file_path);
94 return ` ${r.kind} ${r.name} → ${rel}:${r.start_line}`;
95 });
96 return {
97 content: `${rows.length} match${rows.length > 1 ? 'es' : ''}:\n${lines.join('\n')}`,
98 metadata: { count: rows.length },
99 };
100 }
101}
102
103// ---------------- list_symbols_in_file ----------------

Callers

nothing calls this directly

Calls 2

requireDBFunction · 0.85
searchSymbolsByPrefixMethod · 0.80

Tested by

no test coverage detected