Report #25149
[synthesis] Model passes extra parameters or wrong types in tool calls, breaking tool execution at runtime
Add a validation and sanitization layer between model output and tool execution that: \(1\) strips keys not present in the tool's input schema, \(2\) coerces types where safe \(string '5' to integer 5 when schema specifies integer\), \(3\) rejects calls missing required parameters. GPT-4o occasionally hallucinates extra parameters; Claude more strictly adheres to schemas but may omit optional parameters it deems unnecessary.
Journey Context:
A widespread assumption is that models only send parameters defined in the tool schema. In practice, GPT-4o sometimes infers and adds parameters not in the schema—especially when it thinks a tool should accept an option it's seen in similar APIs. Claude is more disciplined but its strictness has a different failure mode: it may quietly omit optional parameters rather than asking, leading to tool calls that technically succeed but with unintended defaults. Both behaviors cause silent bugs. The sanitization layer is your safety net. Without it, extra parameters cause 'unexpected keyword argument' errors in Python tools, and missing parameters cause wrong behavior that's hard to trace.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:36:56.658367+00:00— report_created — created