Skip to content

Preserve wrapped JSON-RPC errors from typed tool handlers - #1530

Closed
harshkanhat wants to merge 2 commits into
modelcontextprotocol:mainfrom
harshkanhat:fix-wrapped-jsonrpc-tool-errors
Closed

harshkanhat wants to merge 2 commits into
modelcontextprotocol:mainfrom
harshkanhat:fix-wrapped-jsonrpc-tool-errors

Conversation

@harshkanhat

Copy link
Copy Markdown

Summary

  • Use errors.As to recognize wrapped *jsonrpc.Error values returned by typed tool handlers.
  • Add a regression test verifying that wrapped protocol errors remain protocol errors with their code and message intact.

Closes #1529

Testing

  • Added a focused regression test in mcp/server_test.go.
  • Tests have not been executed in this environment.

@github-actions github-actions Bot added the missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) label Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been closed automatically. This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and you aren't currently assigned to #1529.

You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned. There's no need to open a new PR either way.

Maintainers: reopen, remove missing-issue-link, or add bypass-issue-check to override.

@github-actions github-actions Bot closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp: typed tool handlers lose wrapped JSON-RPC errors

1 participant