From 2fe392a472d3dee9507bb4f1a64a4def023e4f18 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 7 Dec 2025 10:46:34 +0900 Subject: [PATCH] Show exception messages for tool call errors Claude Code sometimes only shows `Error: MCP error -32603: Internal error` when an unexpected exception occurs during a tool call. This change broadens the exception handling scope so the server can surface the exception message more often, making failures easier to diagnose. --- lib/mcp/server.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/mcp/server.rb b/lib/mcp/server.rb index 33fa8c11..80ede482 100644 --- a/lib/mcp/server.rb +++ b/lib/mcp/server.rb @@ -304,13 +304,11 @@ def call_tool(request) end end - begin - call_tool_with_args(tool, arguments) - rescue => e - report_exception(e, { request: request }) + call_tool_with_args(tool, arguments) + rescue => e + report_exception(e, request: request) - error_tool_response("Internal error calling tool #{tool_name}: #{e.message}") - end + error_tool_response("Internal error calling tool #{tool_name}: #{e.message}") end def list_prompts(request)