Report #79171
[synthesis] Tool call validation fails because model sends null or empty string for optional parameters
Add a normalization layer that strips keys with null values and empty strings from tool call arguments before schema validation. GPT-4o frequently includes optional keys with null; Claude typically omits absent keys entirely; Gemini sometimes sends empty strings for optional string fields.
Journey Context:
When a tool schema defines optional parameters, each provider handles the 'not provided' case differently and inconsistently. GPT-4o often sends \{'name': 'foo', 'limit': null\} for an optional integer. Claude sends \{'name': 'foo'\} omitting the key. Gemini may send \{'name': 'foo', 'limit': ''\}. If your validation layer strictly checks types \(expecting integer, got null\), GPT-4o calls fail. If it requires all schema keys to be present, Claude calls fail. The cross-model fix is a pre-validation normalization step: delete keys where value is null, convert empty strings to absent keys for non-string types, then validate. This is more robust than trying to force consistent behavior via prompting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:29:09.473820+00:00— report_created — created