Skip to content

fix(mcp): Map common get_sentry_resource param aliases and URL shapes - #1829

Merged
BYK merged 2 commits into
mainfrom
fix/mcp-get-sentry-resource-param-aliases
Nov 3, 2026
Merged

BYK merged 2 commits into
mainfrom
fix/mcp-get-sentry-resource-param-aliases

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Two get_sentry_resource input failures from the last 7 days in sentry/mcp-server:

  • "Either url or resourceType must be provided": ~4.6K/week. The calls carry the right value under the wrong key. The most common keys are resourceId without a type (~830, all issue short IDs), issueId / issue_id (~900), resource + id (~630 / ~360, mostly resource: "issue"), resourceUrl (~530) and issueUrl (~210).
  • "Could not determine resource type from URL": ~2.3K/week. The largest groups are project event URLs /projects/{project}/events/{eventId}/ (~500), issue list URLs /issues/?query=… (~460), alert rule URLs (~380), Explore logs/traces search URLs (~250), and /api/0/… URLs (~180).

What changed:

  • New undocumented schema aliases: issueUrl and resourceUrl map to url, and issueId and id map to resourceId. issueId also implies resourceType: issue. The schema grows from 683 to 710 tokens.
  • A resourceId with no resourceType resolves as an issue only when it looks like an issue ID: an uppercase short ID (PROJECT-123) or a numeric ID. Hex IDs, slugs and titles still need an explicit type.
  • The URL parser handles /[organizations/{org}/]projects/{project}/events/{eventId}/. These resolve as an event by event ID, which get_issue_details already supports.
  • List and search URLs get a specific error that names the right tool: search_issues, find_alert_rules / get_alert_rule, search_logs, search_traces, or the web URL for API links. Other unknown URLs keep the old error.

Open question: multi-credential routing (credential-routing.ts) reads the org only from url, so a call with only an issueUrl / resourceUrl alias falls back to the default credential. I left it alone because routing belongs to the #1669 work.

via @BYK.

--

View Session [Sentry]

Accept issueUrl/resourceUrl as url and issueId/id as resourceId, infer
the issue type for issue-shaped IDs, parse project event URLs, and
point list or search URLs (issues, alerts, logs, traces, API) at the
right tool instead of a generic unknown-URL error.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@vercel

vercel Bot commented Nov 3, 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 3, 2026 12:19pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 3, 2026
@BYK
BYK enabled auto-merge (squash) November 3, 2026 12:14
…source-param-aliases

# Conflicts:
#	packages/mcp-core/src/toolDefinitions.json
@BYK
BYK merged commit 0bf524e into main Nov 3, 2026
35 checks passed
@BYK
BYK deleted the fix/mcp-get-sentry-resource-param-aliases branch November 3, 2026 12:30

This branch was successfully deployed

1 active and 1 inactive deployments
Preview — e3fbf84f Deployed Nov 3, 2026 by vercel[bot]
Actions — e3fbf84f Deployed Nov 3, 2026 by sentry-junior[bot] via eval #1515
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