Report #57054
[synthesis] Model hallucinates tool names or parameters that don't exist in the provided schema
Validate every tool call against the actual schema server-side before execution. On mismatch, return an explicit tool result error: 'Error: tool X does not exist. Available tools are: \[list\].' For parameter type mismatches: 'Error: parameter Y expected type Z, got \[actual\]. Do not invent parameters.'
Journey Context:
GPT-4o occasionally hallucinates tool names that are semantically similar to but distinct from defined tools \(e.g., calling \`search\_files\` when the tool is \`search\_documents\`\). Claude rarely invents tool names but will sometimes pass parameters with wrong types \(string where integer is expected\). Open-source models \(Llama, Mistral\) are more likely to invent entirely new tools. The critical mistake is assuming the model will only call tools you've defined. In production, hallucinated tool calls cause either silent failures \(if you ignore unknown tools\) or crashes \(if you try to execute them\). The error message fed back to the model must be extremely explicit—vague errors like 'invalid tool call' cause retry loops with the same hallucination. Naming the available tools and the expected types in the error message gives the model enough signal to self-correct on the next turn.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:15:23.001671+00:00— report_created — created