Report #58009
[synthesis] Models add conversational filler or markdown wrappers around strict JSON tool outputs, breaking downstream parsers
For Claude, explicitly parse the tool\_use response block and ignore the text block. For GPT-4o, use response\_format: json\_object or Structured Outputs. For Gemini, enforce strict JSON mode or implement regex post-processing to strip markdown fences.
Journey Context:
When asked for JSON, Claude often splits its response into a text block \(containing conversational filler\) and a tool\_use block. GPT-4o might add comments if using basic JSON mode. Gemini frequently wraps JSON in markdown blocks even during function calling. Naive regex parsing fails across models; you must use provider-specific enforcement mechanisms and extract only the structured data payload, discarding conversational preamble.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T03:51:40.289498+00:00— report_created — created