Report #83187
[synthesis] Optional tool parameters with null values cause schema validation failures due to divergent null representation across models
Define optional parameters in JSON Schema without 'null' type. Instruct the model: 'If a value is unknown, omit the key entirely'. Add post-processing to strip keys with string 'null' or null values.
Journey Context:
When a tool parameter is optional and unknown, Claude 3.5 Sonnet often omits the key entirely \(correct JSON Schema behavior\). GPT-4o often passes the literal \`null\` \(which may violate schema if not \`type: \["string", "null"\]\`\). Gemini 1.5 Pro sometimes passes the string \`"null"\`. This synthesis reveals that 'optional' is interpreted differently: Claude=Omission, GPT=Null Literal, Gemini=Stringified Null. Relying on strict schema validation breaks without normalizing the output first.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:13:19.056668+00:00— report_created — created