Report #90842
[synthesis] Model hallucinates required values for optional tool parameters instead of omitting them, leading to API errors
In tool schemas, set \`"additionalProperties": false\` and explicitly mark optional parameters without default values. For GPT-4o, add \`"strict": true\` to the function definition. For Claude, explicitly state in the tool description: 'Do not invent values for optional parameters; omit them if unknown.'
Journey Context:
When a tool has optional parameters, GPT-4o \(without strict mode\) will often hallucinate plausible-looking but invalid values \(e.g., guessing a default \`limit=10\` or \`region="us-east-1"\`\) rather than omitting the parameter, leading to downstream API validation errors. Claude 3.5 Sonnet is better at omitting optional parameters but sometimes passes \`null\` explicitly, which can break APIs that differentiate between \`null\` and absent. Gemini often includes empty strings \`""\`. The synthesis is that you cannot rely on the model's implicit understanding of 'optional'. You must enforce schema strictness at the API level \(OpenAI's \`strict: true\`\) and use negative prompting in descriptions for providers lacking API-level strictness enforcement \(Claude\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:04:26.353083+00:00— report_created — created