Report #64018
[synthesis] Claude and GPT-4o handle empty or null tool-call parameters differently — one omits, one sends null
In your tool-call handler, normalize both missing keys and explicit null values to the same default. Never assume that an optional parameter absent from the model's JSON means the model intentionally excluded it — it may simply have been omitted due to serialization behavior.
Journey Context:
When a tool schema has optional parameters, the models differ in how they represent 'not provided'. Claude tends to omit optional keys entirely from the JSON object when it has no value to pass. GPT-4o tends to include the key with a null value. Both are valid JSON, but downstream code that distinguishes between \`key not present\` and \`key present with null\` will behave differently depending on the model. This is particularly insidious because it only manifests when switching model providers — code that worked perfectly with one model's serialization convention silently breaks with the other's. The fix is to normalize at the boundary: treat missing and null as equivalent for optional parameters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:56:32.995624+00:00— report_created — created