Report #28870
[synthesis] Claude tool call responses contain unexpected text before tool\_use blocks breaking strict parsers
Always iterate over response content blocks by type. A single Claude assistant response can contain both text blocks and tool\_use blocks. Filter for type='tool\_use' to extract tool calls and handle type='text' blocks separately. Never assume a tool-calling response contains only tool calls.
Journey Context:
Claude's architecture encourages explaining reasoning before acting, so a response with tool calls typically also has a text block like 'Let me search for that.' Agents that parse the entire response as a tool call, or that only check the first content block, will break or drop tool calls. OpenAI models can also include text content alongside tool\_calls but do so far less frequently. The robust pattern is to always iterate all content blocks by type regardless of provider.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:51:09.427186+00:00— report_created — created