Skip to content

feat(mcp): Tune tool descriptions for harness search, hide deprecated tools - #1906

Merged
dcramer merged 2 commits into
mainfrom
feat/mcp-tool-search-metadata
Nov 3, 2026
Merged

dcramer merged 2 commits into
mainfrom
feat/mcp-tool-search-metadata

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Follow-up to #1868. Now that every tool is listed directly, the harness picks tools with its own search over tool names and descriptions. Codex uses local BM25 and returns 8 matches. VS Code returns its top 5 by embeddings. Claude Code and Cursor show the model only tool names until it searches. So the metadata has to match the words people actually use, and must not return two tools for the same job.

Deprecated tools are no longer listed

get_ai_conversation_details, search_ai_conversations and search_events are deprecated, but they were in tools/list next to the tools that replaced them. Each one now has a deprecated: { replacedBy: [...] } field on its tool config that names its replacements, and deprecated tools aren't listed in tools/list. toolDefinitions.json carries the same field.

They were only ever reachable through execute_sentry_tool(name: ...), and that tool isn't registered with the flag on. So hiding them doesn't break any working call. With the flag off they stay reachable through the gateway, just as before.

Description audit

I checked about 56 realistic queries against a BM25 index of the tool names and descriptions, for example "sentry client key", "list projects", "notify slack when new issue" and "cron job failed check in". Before this change, 7 of them didn't put the right tool in the top 3. After it, 2 still miss the top 3, and both are in the top 8 that Codex returns. This was a scratch approximation of Codex's search, not the real harness, so the results are directional. Only first lines and pointers to sibling tools changed:

  • find_projects, find_teams, find_organizations, find_releases: they now start with "List or search…", because "list X" is the most common way to ask and none of them contained the word.
  • find_dsns: mentions client keys, SENTRY_DSN and SDK setup.
  • Monitors: find_monitors and get_monitor_details say "cron / scheduled jobs / check-ins". find_monitors now points to find_uptime_monitors and find_metric_monitors, since all three names look alike.
  • create_metric_monitor: now says what a monitor does in plain words: it detects when an error count or latency crosses a threshold.
  • create_alert_rule: names its notification channels: Slack, email and PagerDuty.
  • get_profile / get_profile_details: get_profile is for aggregated flamegraph data across a transaction, and get_profile_details is for one profile by ID or URL. Each now points to the other.
  • get_event_stacktrace: says "stack trace" as well as "stacktrace".
  • get_sentry_resource: says to use it when a user shares a Sentry link.

docs/contributing/adding-tools.md now covers writing descriptions for harness search, plus the deprecated field.

Not in this PR

  • _meta["anthropic/alwaysLoad"] on core tools.
  • Hands-on checks in Claude Code, Codex and Cursor that their search finds these tools.

Checks: tsc, lint, and the logger, toolkit-core, local, docs-mcp, mcp-core, mcp-test-client and mcp-cloudflare test suites pass. The packages/cli suite didn't finish because the sandbox timed out. This PR doesn't touch CLI code.

--

View Session [Sentry]

… tools

With EXPOSE_ALL_TOOLS on, harness tool search (Codex BM25, Claude Code
ToolSearch, Cursor, VS Code) picks tools by name and description.

Hide the deprecated get_ai_conversation_details, search_ai_conversations,
and search_events from tools/list so search does not return them next to
their replacements. They stay reachable through execute_sentry_tool when
the flag is off.

Reword first lines that missed common query terms or blurred similar
tools: "List or search" for find_* tools, DSN client keys, cron vs.
uptime vs. metric monitors, aggregated vs. single profiles, alert
notification channels, and Sentry links for get_sentry_resource.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 3, 2026 8:54pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 3, 2026
Comment thread docs/contributing/adding-tools.md Resolved
Replace the DEPRECATED_TOOL_NAMES list in surfaces.ts with a
`deprecated: { replacedBy: [...] }` field on each tool. isTopLevelTool
keeps deprecated tools out of tools/list; execute_sentry_tool still
reaches them when EXPOSE_ALL_TOOLS is off. toolDefinitions.json carries
the field, and a test checks that each replacement exists and is not
itself deprecated.

Co-Authored-By: David Cramer <david@sentry.io>
@dcramer
dcramer merged commit 799e586 into main Nov 3, 2026
40 of 41 checks passed
@dcramer
dcramer deleted the feat/mcp-tool-search-metadata branch November 3, 2026 21:09

This branch was successfully deployed

2 active deployments
Preview — 982d9c10 Deployed Nov 3, 2026 by vercel[bot]
Actions — 982d9c10 Deployed Nov 3, 2026 by sentry-junior[bot] via eval #1532
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant