Skip to content

fix: do not render views for failed tool calls - #1041

Closed
fredericbarthelet wants to merge 1 commit into
mainfrom
cursor/skip-view-render-on-tool-error-7dea
Closed

fix: do not render views for failed tool calls#1041
fredericbarthelet wants to merge 1 commit into
mainfrom
cursor/skip-view-render-on-tool-error-7dea

Conversation

@fredericbarthelet

@fredericbarthelet fredericbarthelet commented Aug 5, 2026

Copy link
Copy Markdown
Member

Problem

A view tool that returns isError: true still produced a result carrying _meta.viewUUID. Hosts key view rendering off that marker, so the playground (ALP-1535) and DevTools (SKY-465) rendered an empty view on top of the error text — see the empty map in the linked issue.

ext-apps#694 states hosts should not render the app view when a tool call fails.

Changes

  • packages/core: decorateToolHandler no longer attaches viewUUID when the handler returns isError: true. A handler that throws was already unaffected — the SDK builds the error result itself, without our _meta.
  • packages/devtools: the tool panel treats an errored result as "no view": it shows the tool output JSON with the Error badge, plus a short note explaining why the view is not rendered (hosts behave the same way).
  • Docs (api-reference/register-tool) and the app-builder skill reference now say the failure belongs in content, since the view is skipped.

DevTools running the new error-card fixture tool — no iframe, error output, and no viewUUID in the response:

DevTools showing an errored tool call with no view rendered

Tests

  • New unit test in packages/core/src/test/view.test.ts: an error result keeps its own _meta but gets no viewUUID.
  • New DevTools Playwright spec (e2e/tests/tool-error.spec.ts) with an error-card fixture tool: the iframe is absent, the error text and the notice are visible. Verified it fails without the DevTools change.
  • pnpm test, pnpm build, and the full DevTools e2e suite pass.

Linear Issue: ALP-1535

Open in Web Open in Cursor 

A tool returning isError still carried a viewUUID, so hosts (playground,
DevTools) rendered an empty view on top of the error. Skip the viewUUID on
error results and mirror the host behavior in DevTools.

Refs modelcontextprotocol/ext-apps#694

Co-authored-by: Frédéric Barthelet <fredericbarthelet@users.noreply.github.com>
@mintlify

mintlify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
skybridge-staging 🟢 Ready View Preview Aug 5, 2026, 12:07 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants