Skip to content

test(mcp): cover call_tool error-code mapping#75

Merged
asiniscalchi merged 1 commit into
mainfrom
test/mcp-call-tool-error-mapping
May 6, 2026
Merged

test(mcp): cover call_tool error-code mapping#75
asiniscalchi merged 1 commit into
mainfrom
test/mcp-call-tool-error-mapping

Conversation

@asiniscalchi

Copy link
Copy Markdown
Owner

Extract the ToolError -> McpError mapping out of call_tool into a free map_dispatch_result helper so it can be exercised without constructing an rmcp RequestContext (whose Peer constructor is crate-private). Add unit tests for each variant — UnknownTool, InvalidInput, Analyzer::InvalidArgument, Analyzer::LimitTooLarge, Analyzer::Internal — plus the success path forwarding the structured value, locking in the MCP error codes that clients depend on.

Extract the ToolError -> McpError mapping out of `call_tool` into a
free `map_dispatch_result` helper so it can be exercised without
constructing an rmcp `RequestContext` (whose `Peer` constructor is
crate-private). Add unit tests for each variant — UnknownTool,
InvalidInput, Analyzer::InvalidArgument, Analyzer::LimitTooLarge,
Analyzer::Internal — plus the success path forwarding the structured
value, locking in the MCP error codes that clients depend on.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@asiniscalchi asiniscalchi merged commit 27270e6 into main May 6, 2026
2 checks passed
@asiniscalchi asiniscalchi deleted the test/mcp-call-tool-error-mapping branch May 6, 2026 02:23
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