Skip to content

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Aug 27, 2025

  1. Add @JsonValue to serialize JSONRPCError instead of McpError itself.
  2. Improve deprecated constructor McpError(Object error) to create JSONRPCError instance for serializing.
  3. Add missing McpError for bad request.
  4. Use McpError.builder() instead of deprecated new McpError(Object)

Motivation and Context

It's a simple improvement to help troubleshooting.

How Has This Been Tested?

{"code": code,"message": message} produced instead of {"cause":null,"stackTrace":[{"classLoaderName":"app","moduleName":null,"moduleVersion":null,"methodName":"build","fileName":"McpError.java", ...

Breaking Changes

No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

1. Add `@JsonValue` to serialize JSONRPCError instead of McpError itself.
2. Improve deprecated constructor `McpError(Object error)` to create JSONRPCError instance for serializing.
3. Add missing McpError for bad request.
4. Use `McpError.builder()` instead of deprecated `new McpError(Object)`

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
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