Report #60995
[synthesis] Tool call parameters arrive as wrong types — strings instead of integers — breaking validation in multi-model setups
Always add a coercion/normalization layer before tool execution that casts parameters to schema-specified types. Never trust model-emitted types. For Claude, explicitly state the expected type in the parameter description field of the tool schema \(e.g., 'Must be an integer, not a string'\).
Journey Context:
OpenAI's function calling infrastructure performs implicit type coercion to match the JSON schema, so GPT-4o usually sends integers for integer-typed params. Claude's tool use implementation is more literal about what it infers from context and frequently passes numeric values as strings, especially when the value originates from user input or prior tool output that was text. Teams building model-agnostic agents discover this only in production when switching providers, because unit tests with clean inputs never trigger the coercion path. The cross-model synthesis: type coercion is a provider-level behavior, not a spec guarantee, so the integration layer must own it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:51:56.256347+00:00— report_created — created