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

Method execute

src/tools/filesystem/grep.ts:25–36  ·  view source on GitHub ↗
(args: z.infer<typeof ArgsSchema>, ctx: ToolContext)

Source from the content-addressed store, hash-verified

23 argsSchema = ArgsSchema;
24
25 async execute(args: z.infer<typeof ArgsSchema>, ctx: ToolContext): Promise<ToolResult> {
26 const target = args.path
27 ? (path.isAbsolute(args.path) ? args.path : path.resolve(ctx.cwd, args.path))
28 : ctx.cwd;
29 const maxResults = args.max_results ?? 100;
30 const outputMode = args.output_mode ?? 'content';
31
32 if (await hasRipgrep()) {
33 return await this.runRipgrep(args, target, maxResults, outputMode, ctx);
34 }
35 return await this.runNative(args, target, maxResults, outputMode);
36 }
37
38 private async runRipgrep(
39 args: z.infer<typeof ArgsSchema>,

Callers

nothing calls this directly

Calls 4

runRipgrepMethod · 0.95
runNativeMethod · 0.95
hasRipgrepFunction · 0.85
resolveMethod · 0.80

Tested by

no test coverage detected