Report #25327
[synthesis] Model calls a tool that doesn't exist in the provided schema or passes parameters outside the defined schema
Validate every tool call name and parameter shape against your schema before execution. When validation fails, return the error as a tool result message with the list of available tools and their expected parameters. Never crash or silently ignore—treat it like any other tool execution error the model can learn from.
Journey Context:
All models hallucinate tool calls, but the failure signatures differ. GPT-4o may call a tool with a similar-but-wrong name \(read\_file vs readFile\). Claude may invoke a tool it 'remembers' from training data rather than your schema. Smaller open-weight models are even more prone. The critical insight: the API layer does not reject hallucinated tool calls—it passes them through. Your agent loop is the only validation layer. Returning a structured error as a tool result \(e.g., 'Error: tool X not found. Available tools: \[list\]'\) lets the model self-correct in the next turn, which works surprisingly well across providers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:54:51.716069+00:00— report_created — created