Skip to content

fix: skip output schema validation when tool result isError#1045

Closed
codefromthecrypt wants to merge 1 commit intomodelcontextprotocol:mainfrom
codefromthecrypt:no-validate-error
Closed

fix: skip output schema validation when tool result isError#1045
codefromthecrypt wants to merge 1 commit intomodelcontextprotocol:mainfrom
codefromthecrypt:no-validate-error

Conversation

@codefromthecrypt
Copy link

@codefromthecrypt codefromthecrypt commented Jan 27, 2026

Summary

When a tool returns isError: true, its structuredContent is not required to conform to the tool's outputSchema. The Inspector UI was still validating it, showing a spurious "Validation Error" that obscured the actual server-provided error message.

This is the Inspector-side counterpart to modelcontextprotocol/typescript-sdk#1428, which fixes the same validation skip in the SDK's callTool() client method.

Type of Change

  • Bug fix
  • Test updates

Changes Made

  • client/src/components/ToolResults.tsx — added && !isError guard before calling validateToolOutput, matching the SDK behavior
  • client/src/components/__tests__/ToolsTab.test.tsx — added test case confirming error results with non-conforming structuredContent do not trigger validation errors

Related Issues

Depends on modelcontextprotocol/typescript-sdk#1428 for the SDK / CLI-level fix.

Testing

  • Tested in UI mode
  • Tested with SSE transport
  • Added/updated automated tests

Test Results and/or Instructions

  1. Connect to an MCP server that has a tool with an outputSchema
  2. Call the tool in a way that triggers an isError: true response with structuredContent that doesn't match the schema
  3. Verify the UI shows the server's error content without a "Validation Error" banner

Checklist

  • Code follows the style guidelines (ran npm run prettier-fix)
  • Self-review completed

Breaking Changes

None.

Additional Context

Reproduced against IntelliJ's MCP server (get_repositories tool) which returns isError: true with structuredContent containing projects instead of the schema-required roots.

Before:
errors

After:
Screenshot 2026-02-02 at 5 00 18 PM

@codefromthecrypt codefromthecrypt marked this pull request as ready for review January 27, 2026 06:51
@codefromthecrypt codefromthecrypt marked this pull request as draft January 27, 2026 10:08
@codefromthecrypt
Copy link
Author

codefromthecrypt commented Feb 2, 2026

draft until modelcontextprotocol/typescript-sdk#1428 is released, as there are two layers of bugs in the UI.

@codefromthecrypt codefromthecrypt changed the title fix: skip tool output validation on error fix: skip output schema validation when tool result isError Feb 2, 2026
Signed-off-by: Adrian Cole <adrian@tetrate.io>
@codefromthecrypt
Copy link
Author

Closing this out until there is a path forward the spec allows modelcontextprotocol/modelcontextprotocol#2145

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.

1 participant