continuedev/continue · error · Error
Tool ${toolCall.function.name} not found
Error message
Tool ${toolCall.function.name} not found What it means
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`.
Source
Thrown at core/core.ts:1161
} catch (error: any) {
void this.ide.showToast("error", error.message);
return [];
}
});
}
private async handleToolCall(toolCall: ToolCall) {
const { config } = await this.configHandler.loadConfig();
if (!config) {
throw new Error("Config not loaded");
}
const tool = config.tools.find(
(t) => t.function.name === toolCall.function.name,
);
if (!tool) {
throw new Error(`Tool ${toolCall.function.name} not found`);
}
if (!config.selectedModelByRole.chat) {
throw new Error("No chat model selected");
}
// Define a callback for streaming output updates
const onPartialOutput = (params: {
toolCallId: string;
contextItems: ContextItem[];
}) => {
this.messenger.send("toolCallPartialOutput", params);
};
const result = await callTool(tool, toolCall, {
config,
ide: this.ide,
llm: config.selectedModelByRole.chat,View on GitHub (pinned to 5522c6f44c)
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
Defensive patterns
Strategy: fallback
Validate before calling
const tool = config.tools.find(t => t.function.name === call.function.name);
if (!tool) { respondToolError(call, `unknown tool ${call.function.name}`); return; } Type guard
const isKnownTool = (name: string, c: Config) => c.tools.some(t => t.function.name === name);
Try / catch
catch (e) { if (/^Tool .* not found$/.test(e.message)) { return toolNotFoundResult to the model so it can self-correct; } } Prevention
- Keep the tool list sent to the LLM in sync with config.tools
- Return structured tool errors instead of throwing out of the loop
When it happens
Trigger: LLM returns a function name not present in config.tools — hallucinated tool, renamed tool, or custom tool not registered.
Common situations: Model invents tool names; config updated between prompt construction and call; system-prompt/tool-list mismatch.
Related errors
- Tool ${toolName} not found
- No chat model selected
- Config not loaded
- Lazy apply not supported for model ${llm.model}
- Not enough context available to include the system message,
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/11c4e963bb941a96.
Report an issue: GitHub.