claude-code - 💡(How to fix) Fix Malformed tool-call syntax leaks raw parameter fragments into the visible transcript

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When the assistant emits a tool call with incorrect tag syntax (e.g. bare invoke/call instead of the namespaced antml:invoke/antml:parameter), the UI shows Your tool call was malformed and could not be parsed, but it also renders the half-parsed fragments — parameter values such as 1, 1.3, true, and the text body — to the user as plain markdown content.

Root Cause

When the assistant emits a tool call with incorrect tag syntax (e.g. bare invoke/call instead of the namespaced antml:invoke/antml:parameter), the UI shows Your tool call was malformed and could not be parsed, but it also renders the half-parsed fragments — parameter values such as 1, 1.3, true, and the text body — to the user as plain markdown content.

Code Example

⏺ call

  <message text here>
  1
  1.3
  true
RAW_BUFFERClick to expand / collapse

Summary

When the assistant emits a tool call with incorrect tag syntax (e.g. bare invoke/call instead of the namespaced antml:invoke/antml:parameter), the UI shows Your tool call was malformed and could not be parsed, but it also renders the half-parsed fragments — parameter values such as 1, 1.3, true, and the text body — to the user as plain markdown content.

Expected

Unparseable tool-call output should be suppressed or cleanly errored, not displayed to the user as assistant content.

Actual

The malformed call's internal fragments leak into the rendered transcript, e.g.:

⏺ call

  <message text here>
  1
  1.3
  true

Environment

  • Claude Code, model claude-opus-4-8 (1M context)
  • Platform: macOS
  • Reproduced repeatedly when invoking an MCP tool (mcp__voicevox__speak) mid-response.

Notes

The trigger is model-side (the model emitting the wrong tag namespace). The reported defect is the rendering/robustness behavior: a tool call that fails to parse should not surface its raw fragments to the user.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Malformed tool-call syntax leaks raw parameter fragments into the visible transcript