Report #70121
[synthesis] Claude returns conversational text alongside tool\_use blocks breaking parser
Parse Claude's response as a list of content blocks \(type 'text' and type 'tool\_use'\), not as a single-type payload. Filter or ignore text blocks when you only need tool results. If you must suppress the conversational text, add to your system prompt: 'Call tools directly without any preceding explanation or conversational text.' This reduces but does not fully eliminate the behavior.
Journey Context:
GPT-4o with tools typically returns only the tool\_calls array with empty or minimal content. Claude 3.x almost always includes a text content block before the tool\_use block \(e.g., 'Let me look that up for you.'\). This breaks naive parsers that expect either text OR tool calls, not both. The Anthropic API explicitly models responses as content\_block arrays to accommodate this, while OpenAI separates content \(string\) and tool\_calls \(array\) into distinct top-level fields. The architectural difference means your parser must handle mixed content from day one. Attempting to prompt-away the conversational text is fragile; structural handling is robust.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:17:03.991958+00:00— report_created — created