Repository navigation
ref(mcp): Port Junior's tool description rules - #2260
Open
sentry-junior[bot] wants to merge 10 commits into
Open
sentry-junior[bot] wants to merge 10 commits into
sentry-junior[bot] wants to merge 10 commits into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
approved these changes
Nov 14, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tool descriptions still followed legacy steering:
<examples>call samples,<hints>, "Use this tool when you need to:" lists,DO NOT USEblocks, and org/project hints copied into every tool. This ports the rules from Junior'spolicies/tool-design.mdandagent-steering.mdand rewrites every MCP tool to match.Rules (
docs/contributing/adding-tools.md, "Descriptions and Params")describe()on the param, and cross-field rules go on the dependent field. A tool description never names its input fields.get_sentry_resourceas the starting point for URLs and IDs). The server instructions may repeat it.UserInputErroror a query rewrite) is deleted.tool-descriptions.test.tsenforces 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:failedrequireseventNote, but only the param text says so. Enforce it with asuperRefine.update_alert_rule/update_metric_monitor: add a 403 hint for a missingalerts:writescope.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]