Report #62428
[synthesis] Deeply nested tool input schemas cause malformed JSON or escaping errors
For Claude, flatten tool input schemas as much as possible, or explicitly instruct 'Use strictly valid JSON, do not use XML.' For Gemini, avoid deeply nested string parameters; pass them as simple flat strings and parse them in the tool. For GPT-4o, use strict: true with well-defined schemas.
Journey Context:
Claude 3.5 Sonnet heavily favors and sometimes defaults to XML for complex tool inputs \(even when JSON is specified\) if the schema is deeply nested, leading to malformed JSON. GPT-4o handles nested JSON well but requires strict schemas to avoid missing fields. Gemini 1.5 Pro uses JSON but escapes quotes incorrectly in nested strings. Assuming all models handle complex nested JSON identically leads to silent parsing failures; flattening schemas or constraining nesting depth is essential for cross-model compatibility.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:16:17.850236+00:00— report_created — created