Skip to content

Conversation

@codefromthecrypt
Copy link

@codefromthecrypt codefromthecrypt commented Jan 27, 2026

Summary

When a tool returns an error, the output is not guaranteed to conform to the output schema. This change skips the output schema validation when the tool result is an error, preventing incorrect validation errors from being shown.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Refactoring (no functional changes)
  • Test updates
  • Build/CI improvements

Changes Made

  • In ToolResults.tsx, added a check to skip output schema validation if the tool result is an error.
  • Added a new test case in ToolsTab.test.tsx to ensure that output validation is skipped for error results.

Related Issues

Testing

  • Tested in UI mode
  • Tested in CLI mode
  • Tested with STDIO transport
  • Tested with SSE transport
  • Tested with Streamable HTTP transport
  • Added/updated automated tests
  • Manual testing performed

Test Results and/or Instructions

The new test case in ToolsTab.test.tsx covers the changes.

Checklist

  • Code follows the style guidelines (npm run prettier-fix)
  • Self-review completed
  • Code is commented where necessary
  • Documentation updated (README, comments, etc.)

Breaking Changes

None.

Additional Context

Failure case:

$ npx @modelcontextprotocol/inspector  http://localhost:64345/stream --cli --transport http --method tools/call      --tool-name get_repositories
  Failed to call tool get_repositories: MCP error -32602: Structured content does not match the tool's output schema: data must have required property 'roots'

  Failed with exit code: 1

codefromthecrypt and others added 2 commits January 27, 2026 15:36
When a tool returns an error, the output is not guaranteed to conform to the output schema. This change skips the output schema validation when the tool result is an error, preventing incorrect validation errors from being shown.

Signed-off-by: Adrian Cole <[email protected]>
@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

this only addresses the UI not the CLI.. will undraft when it is both

@codefromthecrypt
Copy link
Author

wrong repo I think this has to be fixed in the SDK itself

@codefromthecrypt
Copy link
Author

modelcontextprotocol/typescript-sdk#1428 solves this

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