{"record":{"id":"b8814ca42d2a6dbf","repo":"continuedev/continue","slug":"tool-toolname-not-found","errorCode":null,"errorMessage":"Tool ${toolName} not found","messagePattern":"Tool (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/core.ts","lineNumber":1090,"sourceCode":"            basePolicy,\n            parsedArgs,\n            processedArgs,\n          );\n          return { policy: evaluatedPolicy, displayValue };\n        }\n        return { policy: basePolicy, displayValue };\n      },\n    );\n\n    on(\"tools/preprocessArgs\", async ({ data: { toolName, args } }) => {\n      const { config } = await this.configHandler.loadConfig();\n      if (!config) {\n        throw new Error(\"Config not loaded\");\n      }\n\n      const tool = config?.tools.find((t) => t.function.name === toolName);\n      if (!tool) {\n        throw new Error(`Tool ${toolName} not found`);\n      }\n\n      try {\n        const preprocessedArgs = await tool.preprocessArgs?.(args, {\n          ide: this.ide,\n        });\n        return {\n          preprocessedArgs,\n        };\n      } catch (e) {\n        let errorReason =\n          e instanceof ContinueError ? e.reason : ContinueErrorReason.Unknown;\n        let errorMessage =\n          e instanceof Error\n            ? e.message\n            : `Error preprocessing tool call args for ${toolName}\\n${JSON.stringify(args)}`;\n        return {\n          preprocessedArgs: undefined,","sourceCodeStart":1072,"sourceCodeEnd":1108,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/core.ts#L1072-L1108","documentation":"After config loads successfully, the preprocessArgs handler looks up the tool by function.name; if no configured tool matches toolName it throws `Tool ${toolName} not found`.","triggerScenarios":"Calling preprocessArgs with a toolName that isn't in config.tools (typo, unregistered custom tool, tool removed from config).","commonSituations":"Custom tool not registered in config; renaming a tool; stale tool name from an old session.","solutions":["Verify the exact function.name in config.tools matches toolName","Register the custom tool in config before calling","Check for typos/casing in the tool name"],"exampleFix":"// before\npreprocessArgs({ toolName: \"read_file\", args });\n// after\npreprocessArgs({ toolName: \"readfile\", args }); // must equal t.function.name in config","handlingStrategy":"validation","validationCode":"const names = new Set(config.tools.map(t => t.function.name));\nif (!names.has(toolName)) throw new RangeError(`unknown tool ${toolName}`);","typeGuard":"const isKnownTool = (n: string, c: Config) => c.tools.some(t => t.function.name === n);","tryCatchPattern":"catch (e) { if (e.message.endsWith('not found')) { logMisconfiguredTool(e.message); } }","preventionTips":["Derive tool name constants from config at startup"],"tags":["tools","config","lookup"],"backgroundTag":"tool-not-found","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}