Skip to content

fix(mcp): Move dropped description steering into tool code - #2298

Merged
dcramer merged 2 commits into
mainfrom
fix/mcp-tool-steering-followups
Nov 16, 2026
Merged

dcramer merged 2 commits into
mainfrom
fix/mcp-tool-steering-followups

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Follow-ups from #2260, which removed description text that carried behavior the handlers did not enforce.

403 on Alert and Metric Monitor writes (create_alert_rule, update_alert_rule, create_metric_monitor, update_metric_monitor)

Today a denied write returns API error (403): You do not have permission to perform this action. followed by "you may be able to resolve this by trying again". withAlertWritePermissionHint wraps only the write call and adds what Sentry checks to a bare 403:

  • Alerts need alerts:write and permission to edit alerts in every connected project. An Alert that uses the all-projects source also needs org:write.
  • Metric Monitors need alerts:write in their project.

The message also says that retrying with the same token will not help: reconnect with those scopes, or ask an org Owner or Manager. The error stays an ApiPermissionError, so it remains an expected 4xx with its status. A 403 that names its missing scopes is unchanged, and formatErrorForUser still reports it as Missing Permission.

These 403s are bare because of how the Sentry endpoints check permissions. The workflow and detector endpoints let org:read tokens through to object-level checks (enforce_workflow_edit_permissions, enforce_detector_workflow_connection_permissions, can_edit_detector in workflow_engine/endpoints/validators/utils.py). enforce_scope sends an insufficient_scope challenge only to Seer agent tokens.

There is no org:write pre-check for all-project sources. The server can't see the token's effective scopes (token scopes combined with the member's role), so a pre-check would cost an extra API call and could guess wrong. The 403 guidance covers that case instead.

Other tools

  • create_project adds a guidance field. It tells the agent to give the user the project slug and DSN, points to create_dsn when no DSN was set up, and says when the repository did not link.
  • get_profile adds optional guidance when there is no data: check the exact transaction name with search_traces, try a longer period, or confirm profiling is enabled. In comparison mode it names the period with no profiles.
  • onboarding_status_update rejects status: "failed" without eventNote.

Nothing breaks. guidance is additive in both output schemas. The new eventNote rule rejects only input that the description already called invalid.

via @dcramer.

--

View Session [Sentry]

#2260 removed tool description text that carried behavior the handlers did
not enforce. Put that behavior in code.

- Alert and Metric Monitor writes explain a bare 403: the scope and
  project permission Sentry checks, org:write for the all-projects source,
  and that retrying with the same token will not help. The error stays an
  ApiPermissionError; a 403 that names its scopes keeps the shared Missing
  Permission message.
- create_project returns guidance that tells the user the DSN, points to
  create_dsn when no DSN was set up, and reports a repository that did not
  link.
- get_profile returns guidance when a period has no profiles.
- onboarding_status_update rejects a failed status without eventNote.

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

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 16, 2026 6:27pm UTC

Request Review

@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 16, 2026 18:20
@sentry-junior
sentry-junior Bot requested a review from dcramer November 16, 2026 18:20
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 16, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 486f55c. Configure here.

… 403

Sentry checks detector permissions before it saves, and saves inside one
transaction, so a permission denial never leaves a monitor behind.
@dcramer
dcramer merged commit d629471 into main Nov 16, 2026
34 checks passed
@dcramer
dcramer deleted the fix/mcp-tool-steering-followups branch November 16, 2026 19:37

This branch was previously deployed

2 inactive deployments
Actions — d2c05e94 Deployed Nov 16, 2026 by sentry-junior[bot] via eval #1932
Preview — d2c05e94 Deployed Nov 16, 2026 by vercel[bot]
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