[BUG] show_widget: failed validation call + retry with same title leaves duplicate widget rendered
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Calling mcp__visualize__show_widget (the visualize MCP app), a first call that fails input
validation followed by a retry with the same title can leave two duplicate widget cards
rendered in the chat UI, instead of one. The failed call is not supposed to render anything, but
it does, and the rendered content survives (it does not disappear once the retry succeeds).
This looks related to #53030 and #60052, but is not the same symptom: #53030 shows a widget
rendering then disappearing on an HTTP 400 (transient, self-corrects); here the duplicate from the
failed call persists alongside the successful retry's card.
Also worth flagging on its own: the tool's declared JSON schema lists required: ["loading_messages"]
only (title is optional per schema), but the backend enforces title anyway and throws-32602 when it's missing. This schema/backend mismatch is what produces the first failed call in
practice — a caller has no way to know title is actually required from the schema alone.
What Should Happen?
- The declared schema for
show_widgetshould marktitleas required, matching backend
enforcement, OR the backend should accept a missing title if the schema says it's optional.
- A tool call that fails input validation should never render any UI content — there is nothing for
the caller to "un-render" after a validation error occurs before any processing.
- A retry with the same
titleshould not accumulate a second card once it succeeds.
Steps to Reproduce
- Call
show_widgetwithwidget_codeandloading_messages, omittingtitle. - Call fails: `MCP error -32602: Input validation error: Invalid arguments for tool show_widget:
[{"expected":"string","code":"invalid_type","path":["title"],"message":"Invalid input: expected
string, received undefined"}]`
- Call
show_widgetagain, same (or near-identical)widget_code, this time withtitleincluded. - Call succeeds, content renders.
- Result: the chat UI shows two "Widget from visualize show_widget" cards, not one — one from
the failed call, one from the successful retry.
Error Messages/Logs
MCP error -32602: Input validation error: Invalid arguments for tool show_widget: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"title"
],
"message": "Invalid input: expected string, received undefined"
}
]
Claude Model
Not sure / multiple models
Is this a regression?
Not sure
Last Working Version
_No response_
Claude Code Version
2.1.220 (Claude Code)
Platform
Claude Code desktop app (Code tab)
Operating System
macOS
Terminal/Shell
N/A (desktop app)
Additional Information
Live-reproduced and confirmed by direct user observation of the app UI on 2026-09-05. Two related
issues found in this tracker while investigating, both auto-closed as duplicates by the stale-bot
(closed does not mean fixed):
- #53030 —
show_widgetrenders content then the call fails with HTTP 400; the widget disappears.
Different final symptom (transient vs. persistent duplicate) but same underlying shape: the
client renders before/independently of the tool call's final success/failure signal.
- #60052 — deferred MCP tools fail validation on first call (schema not hydrated), succeed on
retry after ToolSearch. Same general "fails then retry succeeds" call pattern, different
mechanism (show_widget is not a deferred tool here).