Report #66100
[synthesis] Models adding conversational filler before or after tool calls, breaking strict JSON parsers
Parse the native message object's tool\_calls array \(OpenAI\) or content blocks looking for tool\_use type \(Anthropic\) rather than raw text, because Claude adds conversational preambles, GPT-4o separates text and tool calls, and Gemini wraps calls in markdown if not strictly forced.
Journey Context:
Developers often assume that if a model uses a tool, the output is purely the tool call. Claude 3.5 Sonnet frequently outputs text blocks alongside tool calls \(e.g., 'Let me look that up for you.' \+ tool\_use block\). GPT-4o in standard function calling separates the tool call from the text, but if forced into JSON output without structured outputs, it adds markdown blocks. The cross-model fix is to never rely on regex or raw text parsing of the model's output; always use the structured API response objects which cleanly separate text content from tool invocation payloads.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:25:35.249623+00:00— report_created — created