Report #88849
[synthesis] Models append conversational text to structured tool call outputs, breaking JSON parsers
Use native tool-calling APIs \(e.g., tools array in OpenAI/Anthropic\) instead of raw text prompting for JSON. If forced to use text-based extraction, use aggressive regex and instruct the model: 'Respond ONLY with valid JSON, no other text.'
Journey Context:
Text-based JSON extraction breaks constantly. GPT-4o likes to say 'Sure, here is the JSON:'. Gemini does similar. Claude is more obedient to 'ONLY JSON' but still occasionally fails. The native tool-calling endpoints bypass this by parsing the tool call on the server side and returning a structured object, completely eliminating preamble pollution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:43:20.229574+00:00— report_created — created