Skip to content

[Doc] Fix server_context description for Exception Reporting#370

Open
koic wants to merge 1 commit into
modelcontextprotocol:mainfrom
koic:fix_exception_reporter_server_context
Open

[Doc] Fix server_context description for Exception Reporting#370
koic wants to merge 1 commit into
modelcontextprotocol:mainfrom
koic:fix_exception_reporter_server_context

Conversation

@koic
Copy link
Copy Markdown
Member

@koic koic commented Jun 3, 2026

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.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

## 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.
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