Skip to content

Clarify host behavior for rendering an MCP App view when the tool result is an error (isError: true) #694

Description

@fredericbarthelet

Summary

The spec defines how a host renders a view once a tool with a ui.resourceUri returns, but it doesn't say what a host should do when that tool call returns an error result (isError: true). Hosts are diverging, and I'd like a recommendation (ideally normative) so implementations stay consistent.

  • ChatGPT unmount the view iframe (it was already mounted when the output was received)
  • Claude doesn't mount the view iframe
  • Goose keep the iframe mounted and proceed with rendering as usual. The isError value is not accessible from the view.

What the spec covers today

The ui/notifications/tool-result notification and the rendering flow describe the success path (result.content / structuredContent are forwarded to the view). There's ui/notifications/tool-cancelled for cancellation, but nothing addresses a completed tool call whose result has isError: true, e.g.:

{
  "content": [{ "type": "text", "text": "My custom error message returned from tool" }],
  "isError": true,
}

Questions

  • When a tool result has isError: true, should the host skip rendering the view and fall back to the normal error/text presentation?
  • If the view is still rendered, should the host deliver the error via ui/notifications/tool-result (with isError preserved), via a distinct signal, or not at all? If the same notification is used, how to access the isError boolean?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions