MCPcopy Create free account
hub / github.com/altic-dev/Pilot / createToolWithParsedArgs

Function createToolWithParsedArgs

src/tools/experiment-code-update.ts:24–43  ·  view source on GitHub ↗
(tool: any)

Source from the content-addressed store, hash-verified

22
23// Wrapper to parse stringified JSON arguments from Anthropic SDK
24function createToolWithParsedArgs(tool: any) {
25 return {
26 ...tool,
27 execute: async (args: any) => {
28 // Parse view_range if it's a stringified array
29 if (args.view_range && typeof args.view_range === "string") {
30 try {
31 args.view_range = JSON.parse(args.view_range);
32 } catch (e) {
33 // If parsing fails, leave it as-is
34 logger.warn("Failed to parse view_range", {
35 view_range: args.view_range,
36 error: e instanceof Error ? e.message : String(e),
37 });
38 }
39 }
40 return tool.execute(args);
41 },
42 };
43}
44
45/**
46 * Create tools that operate within a Docker container

Callers 1

createDockerToolsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected