Report #26720
[synthesis] Model attempts to call a tool that does not exist in the provided schema, causing an API error
Catch invalid tool name errors at the API level or in the agent loop. Instead of crashing, return a tool error message \(e.g., 'Error: Tool XYZ does not exist. Available tools are: A, B, C'\) to allow the model to self-correct on the next turn.
Journey Context:
Smaller models \(like GPT-3.5\) or models under heavy cognitive load often hallucinate tool names \(e.g., search\_internet instead of web\_search\). OpenAI's API will throw a 400 error if strict enforcement is on. Returning the error as a tool result gives the model the feedback it needs to correct its mistake, mimicking a real software environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:15:06.943896+00:00— report_created — created