From 8c911304519ce0e89a4fd1ae9e58730b322b9c3f Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sat, 11 Apr 2026 13:54:00 +0900 Subject: [PATCH] [Doc] Fix `server_context` description for Exception Reporting ## Motivation and Context The README's Exception Reporting section claimed that `server_context` includes `{ tool_name: "name", arguments: { ... } }` for tool calls. This matched the implementation in 0.3.0 through 0.5.0, but the `{ tool_name:, arguments: }` context was removed in 0.5.1 when exception reporting was consolidated into the centralized `{ request: request }` path. The README was never updated to reflect this. `Server#report_exception` is now only called with `{ request: request }` (from `handle_request`) or `{ notification: "..." }` (from notification delivery rescues), and tool call failures flow through the `{ request: ... }` path after being wrapped in a `RequestHandlerError`. The stale description misled users into expecting `tool_name` and `arguments` in their exception reporter callbacks. ## How Has This Been Tested? Documentation-only change. No behavioral modification. ## Breaking Changes None. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bdf0bd7d..30dd409a 100644 --- a/README.md +++ b/README.md @@ -423,10 +423,10 @@ The exception reporter receives two arguments: - `exception`: The Ruby exception object that was raised - `server_context`: A hash containing contextual information about where the error occurred -The server_context hash includes: +The `server_context` hash includes: -- For tool calls: `{ tool_name: "name", arguments: { ... } }` -- For general request handling: `{ request: { ... } }` +- For request handling failures: `{ request: { ... } }` (the raw JSON-RPC request hash) +- For notification delivery failures: `{ notification: "tools_list_changed" }` (or the relevant notification name) When an exception occurs: