{"record":{"id":"11c4e963bb941a96","repo":"continuedev/continue","slug":"tool-toolcall-function-name-not-found","errorCode":null,"errorMessage":"Tool ${toolCall.function.name} not found","messagePattern":"Tool (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/core.ts","lineNumber":1161,"sourceCode":"      } catch (error: any) {\n        void this.ide.showToast(\"error\", error.message);\n        return [];\n      }\n    });\n  }\n\n  private async handleToolCall(toolCall: ToolCall) {\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(\n      (t) => t.function.name === toolCall.function.name,\n    );\n\n    if (!tool) {\n      throw new Error(`Tool ${toolCall.function.name} not found`);\n    }\n\n    if (!config.selectedModelByRole.chat) {\n      throw new Error(\"No chat model selected\");\n    }\n\n    // Define a callback for streaming output updates\n    const onPartialOutput = (params: {\n      toolCallId: string;\n      contextItems: ContextItem[];\n    }) => {\n      this.messenger.send(\"toolCallPartialOutput\", params);\n    };\n\n    const result = await callTool(tool, toolCall, {\n      config,\n      ide: this.ide,\n      llm: config.selectedModelByRole.chat,","sourceCodeStart":1143,"sourceCodeEnd":1179,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/core.ts#L1143-L1179","documentation":"handleToolCall looks up config.tools by the tool call's function.name; an unmatched name (model hallucinating a tool, or tool removed from config) throws `Tool ${name} not found`.","triggerScenarios":"LLM returns a function name not present in config.tools — hallucinated tool, renamed tool, or custom tool not registered.","commonSituations":"Model invents tool names; config updated between prompt construction and call; system-prompt/tool-list mismatch.","solutions":["Ensure the tool list sent to the model matches config.tools exactly","Register missing tools or fix renamed function.name","If hallucination, tighten prompts or retry the turn"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const tool = config.tools.find(t => t.function.name === call.function.name);\nif (!tool) { respondToolError(call, `unknown tool ${call.function.name}`); return; }","typeGuard":"const isKnownTool = (name: string, c: Config) => c.tools.some(t => t.function.name === name);","tryCatchPattern":"catch (e) { if (/^Tool .* not found$/.test(e.message)) { return toolNotFoundResult to the model so it can self-correct; } }","preventionTips":["Keep the tool list sent to the LLM in sync with config.tools","Return structured tool errors instead of throwing out of the loop"],"tags":["tools","llm","lookup","hallucination"],"backgroundTag":"tool-not-found","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}