Skip to content

fix(search): Keep the output keys that connected clients still require - #2919

Open
sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/search-keep-removed-output-keys
Open

sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/search-keep-removed-output-keys

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

#2846 removed explanation from every search tool's output and stopped emitting timeSeries unless a series was requested. Both keys were required in the listed output schemas. MCP SDK clients validate each result against the outputSchema they cached at tools/list, so a client that listed tools before that deploy rejects every search result until it lists tools again.

This PR puts both keys back as required and emits them as null:

  • retiredOutputField() (z.null(), "Retired; always null.") is the schema for a key a tool no longer fills.
  • All eight search tools emit explanation: null.
  • timeSeries is required again: the series or null on errors, logs, spans and metrics, always null on profiles.

output-required-keys.json now lists the top-level required output keys of every tool. Removing one from a schema means keeping it with retiredOutputField() instead; a new required key gets a new line. docs/contributing/tool-responses.md says so.

A stale client that requests a series can still break: #2846 also gave timeSeries the former transformedTimeSeries shape. Those clients lack the new timeSeries input in their cached input schema, so this should be rare.

Open decision: the list holds top-level keys only. Nested keys (for example get_snapshot's approval.autoApproved, dropped about a week ago) would need about 1,800 path entries. Worth it, or keep it top-level?

Fixes #2918

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_33826307ff28ff4e658b51de064825a7.

--

View Session [Sentry]

#2846 removed `explanation` from every search tool's
output and stopped emitting `timeSeries` unless a series was requested.
Both keys were required in the listed output schemas. A client that
listed tools before that deploy validates each result against its cached
schema, so it rejected every search result until it listed tools again.

Emit both keys as `null` again, typed as `retiredOutputField()`, and keep
them required. `timeSeries` stays the series payload on the trace-item
datasets and `null` on profiles.

Add `output-required-keys.test.ts`, which fails when a tool stops
requiring a top-level output key listed in `output-required-keys.json`,
or requires one that is not listed yet.

Fixes #2918
@vercel

vercel Bot commented Dec 4, 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 4, 2026 7:54pm UTC
sentry-local Ready Ready Preview Dec 4, 2026 7:54pm UTC

Request Review

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

📊 MCP Server Token Cost Report

Summary

  • Total Tokens: 70603 tokens
  • Tool Count: 79 tools
  • Average: 894 tokens/tool

Per-Tool Breakdown

Tool Tokens % of Total
get_issue_details 4049 5.7%
get_alert_rule 2245 3.2%
find_releases 1805 2.6%
get_issue_activity 1759 2.5%
update_alert_rule 1653 2.3%
search_traces 1624 2.3%
get_replay_details 1602 2.3%
search_metrics 1524 2.2%
search_logs 1509 2.1%
create_alert_rule 1506 2.1%
get_monitor_details 1501 2.1%
update_metric_monitor 1479 2.1%
create_metric_monitor 1458 2.1%
search_errors 1404 2%
update_issue 1394 2%
get_event_stacktrace 1381 2%
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.8%
get_profile_details 1203 1.7%
find_related_issues 1171 1.7%
get_uptime_monitor_details 1163 1.6%
render_issue_chart 1141 1.6%
create_monitor 1135 1.6%
search_issue_events 1109 1.6%
onboarding_status_update 1109 1.6%
search_replays 1083 1.5%
get_release_details 1056 1.5%
get_dashboard_details 1052 1.5%
search_attributes 1012 1.4%
search_issues 974 1.4%
search_docs 973 1.4%
search_profiles 914 1.3%
find_alert_rules 908 1.3%
update_uptime_monitor 889 1.3%
create_uptime_monitor 883 1.3%
search_agent_conversations 830 1.2%
find_dropped_events 819 1.2%
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.5%
find_dsns 319 0.5%
find_organizations 311 0.4%
get_snapshot_image 302 0.4%
analyze_issue_with_seer 300 0.4%
approve_snapshot 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.

@sentry-junior
sentry-junior Bot marked this pull request as ready for review December 4, 2026 21:08
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner December 4, 2026 21:08
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Dec 4, 2026

This branch was successfully deployed

3 active deployments
Actions — bbe87761 Deployed Dec 4, 2026 by sentry-junior[bot] via eval #2278
Preview – cli — bbe87761 Deployed Dec 4, 2026 by vercel[bot]
Preview – sentry-local — bbe87761 Deployed Dec 4, 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.

Search tools dropped required output keys, so already-connected clients reject every search result

0 participants