Skip to content

fix(mcp): Name the replacements when a client calls a removed or deprecated tool - #2847

Draft
sentry-junior[bot] wants to merge 2 commits into
mainfrom
fix/mcp-keep-deprecated-tools-callable
Draft

sentry-junior[bot] wants to merge 2 commits into
mainfrom
fix/mcp-keep-deprecated-tools-callable

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

A call to a tool name the session doesn't register gets the SDK's bare Tool X not found error. That error doesn't say which tool to use instead. It happens with deleted tools like find_issues and list_projects. It also happens with deprecated tools like search_events, which aren't registered when EXPOSE_ALL_TOOLS is on.

For these names, the unknown-tool handler in server.ts now answers with a -32602 error that names the replacements, for example Tool search_events was removed from the Sentry MCP server. Use search_errors, search_logs, search_traces, search_metrics, search_profiles, search_replays instead. The replacements come from two places:

  • Deprecated tools: the tool's deprecated.replacedBy, looked up in the session's tool registry.
  • Deleted tools: REMOVED_TOOL_REPLACEMENTS in tools/surfaces.ts, which covers find_issues, list_issues, list_events, list_issue_events, list_projects, list_organizations, find_errors, find_transactions and find_tags.

Other details:

  • The error names only replacements that the session registers. If none of them are registered, it only says the tool was removed.
  • The span still records error.type: unknown_tool.
  • Deprecated tools stay out of tools/list and still can't be called directly, so the tool count doesn't change.
  • The message for the removed search_sentry_tools and execute_sentry_tool gateway tools is unchanged.
  • docs/contributing/adding-tools.md describes both cases.

via @dcramer.

--

View Session [Sentry]

@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Dec 3, 2026 9:35pm UTC
sentry-local Ready Ready Preview Dec 3, 2026 9:35pm UTC

Request Review

Comment thread packages/mcp-core/src/server.ts Resolved
@dcramer

dcramer commented Dec 3, 2026

Copy link
Copy Markdown
Member

i disagree this is stupid we're not going to fix bugs in the users harness

junior what harness is causing these issues?

Calls to tool names the server no longer has, such as find_issues or
list_projects, got the SDK's bare "Tool X not found" error.
REMOVED_TOOL_REPLACEMENTS in tools/surfaces.ts maps those names to the
tools that replaced them, and the unknown-tool handler now answers with
a -32602 error that names the replacements this session registers.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@sentry-junior
sentry-junior Bot force-pushed the fix/mcp-keep-deprecated-tools-callable branch from 44b81f1 to 98477db Compare December 3, 2026 21:25
@sentry-junior sentry-junior Bot changed the title fix(mcp): Keep deprecated tools callable and name replacements of removed ones fix(mcp): Name the replacements when a client calls a removed tool Dec 3, 2026
Deprecated tools such as search_events are not registered when
EXPOSE_ALL_TOOLS is on, so a direct call got the SDK's bare "not found"
error. The unknown-tool handler now looks the name up in the tool
registry and, for a deprecated tool, answers with the same -32602 error
naming its replacedBy tools that the session registers. Deprecated tools
stay out of tools/list and stay uncallable.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@sentry-junior sentry-junior Bot changed the title fix(mcp): Name the replacements when a client calls a removed tool fix(mcp): Name the replacements when a client calls a removed or deprecated tool Dec 3, 2026

This branch was successfully deployed

3 active deployments
Preview – sentry-local — 00fd1cfe Deployed Dec 3, 2026 by vercel[bot]
Preview – cli — 00fd1cfe Deployed Dec 3, 2026 by vercel[bot]
Actions — 00fd1cfe Deployed Dec 3, 2026 by sentry-junior[bot] via eval #2248
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