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.
This commit is contained in:
parent
ca934456de
commit
b29d522d27
1 changed files with 34 additions and 6 deletions
|
|
@ -338,13 +338,11 @@ module MCP
|
|||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue