Skip to content

fix(mcp): Read snapshot approval status and approvers - #2857

Merged
NicoHinderling merged 1 commit into
mainfrom
nico/fix-snapshot-approval-status
Dec 3, 2026
Merged

NicoHinderling merged 1 commit into
mainfrom
nico/fix-snapshot-approval-status

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

get_snapshot read approval_info from the snapshot details endpoint (/organizations/{org}/preprodartifacts/snapshots/{id}/), but that endpoint has never returned it. So approval was always null, and an agent couldn't tell whether a snapshot needs approval. The test fixture used the same made-up shape, which hid the bug.

The endpoint returns approval_status (approved, auto_approved, requires_approval, or null; stale approvals already don't count) and approvers. approval is now built from those:

approval: {
  status: string | null,
  approvers: { name, username, source, approvedAt }[]
} | null

It is null only when approval_status is null and approvers is empty. autoApproved is dropped since it equals status === "auto_approved". Approver email and avatar_url are left out of the output. Test fixtures now use the real response shape, and toolDefinitions.json is regenerated for the new output schema.

Read-only half of EME-1369.

via @NicoHinderling.

--

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 6:42pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Dec 3, 2026 6:42pm UTC

Request Review

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

📊 MCP Server Token Cost Report

Summary

  • Total Tokens: 71259 tokens
  • Tool Count: 78 tools
  • Average: 914 tokens/tool

Per-Tool Breakdown

Tool Tokens % of Total
get_issue_details 4049 5.7%
get_alert_rule 2245 3.2%
search_logs 1837 2.6%
search_metrics 1836 2.6%
search_traces 1835 2.6%
find_releases 1805 2.5%
get_issue_activity 1759 2.5%
update_alert_rule 1653 2.3%
get_replay_details 1602 2.2%
create_alert_rule 1506 2.1%
get_monitor_details 1501 2.1%
update_metric_monitor 1479 2.1%
create_metric_monitor 1458 2%
update_issue 1394 2%
get_event_stacktrace 1381 1.9%
get_snapshot 1370 1.9%
render_sentry_chart 1362 1.9%
get_profile 1291 1.8%
get_agent_conversation_details 1278 1.8%
find_monitors 1261 1.8%
get_alert_options 1236 1.7%
search_profiles 1228 1.7%
search_errors 1214 1.7%
get_profile_details 1203 1.7%
find_related_issues 1171 1.6%
get_uptime_monitor_details 1163 1.6%
render_issue_chart 1141 1.6%
create_monitor 1135 1.6%
onboarding_status_update 1109 1.6%
search_issue_events 1103 1.5%
search_replays 1095 1.5%
get_release_details 1056 1.5%
get_dashboard_details 1052 1.5%
search_attributes 1012 1.4%
search_issues 977 1.4%
search_docs 973 1.4%
find_alert_rules 908 1.3%
update_uptime_monitor 873 1.2%
create_uptime_monitor 871 1.2%
search_agent_conversations 830 1.2%
find_dropped_events 819 1.1%
get_metric_monitor_details 797 1.1%
create_project 793 1.1%
update_dsn 765 1.1%
get_issue_user_reports 630 0.9%
get_latest_base_snapshot 623 0.9%
find_dashboards 553 0.8%
link_issue 545 0.8%
find_uptime_monitors 537 0.8%
get_issue_breadcrumbs 492 0.7%
unlink_issue 476 0.7%
find_metric_monitors 471 0.7%
get_issue_tag_values 469 0.7%
find_project_members 448 0.6%
update_project 441 0.6%
get_sentry_resource 429 0.6%
submit_feedback_to_sentry_team 426 0.6%
add_issue_note 404 0.6%
delete_monitor_environment 363 0.5%
find_teams 351 0.5%
find_projects 346 0.5%
delete_alert_rule 345 0.5%
delete_uptime_monitor 333 0.5%
delete_metric_monitor 331 0.5%
create_dsn 326 0.5%
add_team_to_project 324 0.5%
remove_team_from_project 320 0.4%
find_dsns 319 0.4%
find_organizations 311 0.4%
get_snapshot_image 302 0.4%
analyze_issue_with_seer 300 0.4%
get_event_attachment 299 0.4%
get_trace_details 282 0.4%
create_team 266 0.4%
get_span_details 263 0.4%
whoami 261 0.4%
get_sentry_mcp_info 142 0.2%
get_doc 102 0.1%

Note: This measures the static overhead of tool definitions sent to LLM clients with every request. Lower is better.

MCP Apps views

Each ui:// view as a host receives it from resources/read.

View MIME type Raw Gzip Brotli Budget % of budget
ui://sentry/chart/v6.html text/html;profile=mcp-app 19,249 B 7,913 B 7,014 B 24,576 B 78.3%

The budget applies to raw bytes, and the view's generator fails over it.

get_snapshot read approval_info, which the snapshot details endpoint never
returns, so approval was always null. Build approval from the
approval_status and approvers fields the endpoint does return.

Refs EME-1369
@NicoHinderling
NicoHinderling force-pushed the nico/fix-snapshot-approval-status branch from f02ce92 to d7a19e0 Compare December 3, 2026 18:41
@NicoHinderling
NicoHinderling marked this pull request as ready for review December 3, 2026 18:41
@NicoHinderling
NicoHinderling requested a review from a team as a code owner December 3, 2026 18:41
@vercel
vercel Bot temporarily deployed to Preview – sentry-local December 3, 2026 18:41 Inactive
@NicoHinderling
NicoHinderling added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 728bcc6 Dec 3, 2026
36 checks passed
@NicoHinderling
NicoHinderling deleted the nico/fix-snapshot-approval-status branch December 3, 2026 19:04
github-actions Bot pushed a commit to Fields-Education/sentry-mcp that referenced this pull request Dec 4, 2026
Adds `approve_snapshot` so an agent can approve a preprod snapshot's
visual changes when a user asks. It sits behind a new `snapshots` skill
("Approve Snapshots", off by default) and requires `project:releases`.
This is the write half of EME-1369; the read half is
getsentry#2857.

It calls `POST
/api/0/organizations/{org}/preprodartifacts/{artifact_id}/approve/` with
`{"feature_type": "snapshots"}` through a new
`SentryApiService.approveSnapshot`. `@sentry/api` has no wrapper for
this endpoint.

- `201 {"detail": "Approved"}` returns `result: "approved"`, and `200
{"detail": "Already approved"}` returns `result: "already_approved"`.
`requestJSON` only exposes the body, so the tool maps on `detail`, not
the status code.
- A `400`, such as "This build doesn't need approval", becomes a
`UserInputError` with the API's `detail`.

`defaultEnabled: false` means the remote server's OAuth consent screen
leaves `snapshots` unchecked. The stdio server (`sentry mcp`) still
grants every active skill when no `--skills` flag is given, so
`snapshots` is on there by default, like `triage` and
`project-management`.

The CLI's copy of the skill list (`MCP_SKILL_NAMES`) and its MCP config
tests now include `snapshots`. Tools available to every skill now list
`snapshots` in the generated definitions. The regenerated definitions
also add the tool to the plugin agents' `allowedTools`.

The `@sentry/mcp-server` bundle budget goes from 3.77 to 3.78 MiB.
`main` was only 677 bytes under the budget, and this tool adds about 1.7
KB, bringing the bundle to 3,954,128 bytes. The new budget leaves about
9 KB of headroom, which is what the budget's comment intends.

Refs EME-1369

<!-- junior-request-attribution:start -->
via @NicoHinderling.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AD0ASU4QCY3G%3A1796323785.570449 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AD0ASU4QCY3G%3A1796323785.570449)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0ASU4QCY3G%3A1796323785.570449/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Nico Hinderling <9902528+NicoHinderling@users.noreply.github.com>
Co-authored-by: Nico Hinderling <NicoHinderling@users.noreply.github.com>

This branch was successfully deployed

2 active and 1 inactive deployments
Preview – cli — d7a19e04 Deployed Dec 3, 2026 by vercel[bot]
Actions — d7a19e04 Deployed Dec 3, 2026 by NicoHinderling via eval #2228
Preview – sentry-local — d7a19e04 Deployed Dec 3, 2026 by vercel[bot]
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