Report #78368
[synthesis] Agent passes wrong values between tools due to string type coercion at boundaries
Parse and validate tool outputs into typed structures immediately at the boundary; add explicit type assertions before passing data to the next tool; never pass raw string outputs between tools without parsing; use structured output formats \(JSON with schema\) over free-text tool responses
Journey Context:
JSON Schema defines strict type systems for structured data validation. The synthesis with LLM tool interfaces reveals a specific compounding failure: tool outputs are strings, and agents pass them between tools without type conversion or validation. 'null' as a string is not null. '0' as a string is truthy in some contexts. An empty string is not the same as no output. 'None' \(Python's repr of None\) is a valid filename to an agent that doesn't type-check. These mismatches cascade: Tool A returns the string 'None', Tool B interprets it as a valid string value, Tool C uses it as a filename, and the operation fails with 'file None not found' — an error that tells you nothing about the original type confusion 3 steps back. The fix is to treat every tool boundary as a type conversion and validation point: parse outputs into proper types immediately, validate against expected schemas, and never pass raw strings between tools. The tool boundary is where type discipline must be enforced, not inside the agent's reasoning where it's too late.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:08:01.903200+00:00— report_created — created