Skip to content

ref(mcp): Port Junior's tool description rules - #2260

Open
sentry-junior[bot] wants to merge 10 commits into
mainfrom
feat/mcp-tool-description-rules
Open

sentry-junior[bot] wants to merge 10 commits into
mainfrom
feat/mcp-tool-description-rules

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Tool descriptions still followed legacy steering: <examples> call samples, <hints>, "Use this tool when you need to:" lists, DO NOT USE blocks, and org/project hints copied into every tool. This ports the rules from Junior's policies/tool-design.md and agent-steering.md and rewrites every MCP tool to match.

Rules (docs/contributing/adding-tools.md, "Descriptions and Params")

  • A tool description says what the tool does to which Sentry object and what it returns. The first sentence carries the search terms for harness tool search.
  • Name a sibling tool only when the contrast is the contract, in one line.
  • Field meaning goes in describe() on the param, and cross-field rules go on the dependent field. A tool description never names its input fields.
  • No examples or hints. Search syntax stays, on the query param.
  • Not every harness loads server instructions, so each tool keeps the routing it needs (for example, get_sentry_resource as the starting point for URLs and IDs). The server instructions may repeat it.
  • Prose that only repeats a handler check (a UserInputError or a query rewrite) is deleted.

tool-descriptions.test.ts enforces these as hard limits: 512 characters per tool description (down from 2,048) and 256 per param, including nested params. It also rejects <examples>/<hints> and fails when a description names its own input fields.

Tool descriptions went from 67.6k to 17.8k characters, and param descriptions from 70.7k to 44.0k. Total tool definition tokens went from about 76.7k to 59.8k; most of what remains is output schemas. The change is text only: no schemas, defaults, validation, or handler output changed.

Follow-ups. This text carried behavior that the handlers don't enforce yet, so it belongs in code:

  • create_project: add a response note when the repository fails to link, and one that tells the user the DSN.
  • onboarding_status_update: failed requires eventNote, but only the param text says so. Enforce it with a superRefine.
  • update_alert_rule / update_metric_monitor: add a 403 hint for a missing alerts:write scope.
  • All-project metric monitor sources need org:write. Nothing checks this before the API call.
  • get_profile: add an empty-result response note (exact transaction name, longer period, profiling enabled).

via @dcramer.

--

View Session [Sentry]

sentry-junior Bot and others added 10 commits November 13, 2026 23:36
Add the description and param rules, enforce 512/256 character limits with a
shrink-only param baseline, and trim the shared params, gateway tools, and
server instructions.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
Some harnesses do not load server instructions, so tool and param text must
stand alone. The org and project slug params carry the org/project notation.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
Rewrite the setup, release, snapshot, and docs tool descriptions to the
rules in docs/contributing/adding-tools.md: what the tool does and
returns, one sibling-contrast line where it matters, and no examples,
hints, or use-case lists. Param descriptions now say what the value is
and carry their cross-field rules. Rules the handlers already enforce
with UserInputError are no longer repeated in prose.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
Rewrite the search_*, trace, span, profile, replay, agent conversation,
dropped events, and dashboard tool descriptions to the rules in
docs/contributing/adding-tools.md: what the tool returns in user words,
one short sibling-routing line, and no examples, hints, or use-case lists.
Move field meaning and cross-field rules onto the params, keep the logs
regex syntax on the search_logs query param, and drop prose the handlers
already enforce.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
Cut call samples, hints, use-case lists, and field names from the alert
rule, metric monitor, cron monitor, and uptime monitor tool descriptions.
Each description now says what the tool does and returns, with one line
that contrasts cron, uptime, and metric monitors and alert rules.

Field gotchas moved onto the params they describe, such as condition
result codes, percent thresholds, and Slack and Teams destinations.
Prose that repeated handler validation is gone. Schemas and behavior are
unchanged.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
Cut legacy steering (examples, hints, use-case and DO NOT USE lists) from
the issue, event, and resource tool descriptions. Keep what the model
needs: what each tool returns, one sibling contrast where tools look
alike, search syntax on the query params, and cross-field rules on the
dependent param. Drop prose the handlers already enforce or that the
responses already carry.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
…explore' into feat/mcp-tool-description-rules

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
…alerts' into feat/mcp-tool-description-rules

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
…issues' into feat/mcp-tool-description-rules

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
Every tool and param fits the limits after the rewrite, so the checks are hard
limits. search_logs overrides its query description at the use site instead
of through a one-off builder option.

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

vercel Bot commented Nov 14, 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 14, 2026 12:08am UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview — 7acf91eb Deployed Nov 14, 2026 by vercel[bot]
Actions — 7acf91eb Deployed Nov 14, 2026 by sentry-junior[bot] via eval #1904
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