From b25a8f9f9ec62bdb40670c23b543d8ec0f0bf943 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Tue, 29 Sep 2026 15:11:38 +0000 Subject: [PATCH] test(mcp): pin the typed unknown-tool refusal on the rmcp wire #2517 made an unknown tool name a non-retryable invalid_request (JSON-RPC -32602 with typed data), which is also the MCP spec code for an unknown tool. The rmcp wire matrix test still pinned the untyped -32603 from before, while its raw-dispatch parity check already passed. Pin the whole error object the wire carries instead of the code alone. --- crates/tracedecay/src/mcp/server/rmcp.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/crates/tracedecay/src/mcp/server/rmcp.rs b/crates/tracedecay/src/mcp/server/rmcp.rs index e5ffd581e4..afcfb9103d 100644 --- a/crates/tracedecay/src/mcp/server/rmcp.rs +++ b/crates/tracedecay/src/mcp/server/rmcp.rs @@ -464,9 +464,20 @@ mod tests { .assert_last_response_matches_raw_dispatch(false) .await; assert_eq!( - fixture.last_response()["error"]["code"], - json!(-32603), - "handler error code is a host-visible protocol contract", + fixture.last_response()["error"], + json!({ + "code": -32602, + "message": "tool project route failed: reason_code=unknown_tool retryable=false: unknown tool: tracedecay_not_a_tool", + "data": { + "tool": "tracedecay_not_a_tool", + "code": "unknown_tool", + "reason_code": "unknown_tool", + "kind": "invalid_request", + "retryable": false, + "detail": "unknown tool: tracedecay_not_a_tool", + }, + }), + "an unknown tool is a non-retryable invalid-params refusal on the wire", ); assert!( handler_error.to_string().contains("unknown tool"),