Rejected regionUrl errors don't say how to recover when an agent passes the organization's web URL

Open Beginner friendly
#2,777 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Start with packages/mcp-core/src/internal/tool-helpers/validate-region-url.ts around lines 58–65 and read the existing rejection message. Keep the allowlist behavior, then make the error explain that callers should use regionUrl from find_organizations rather than webUrl, or omit regionUrl. Done when rejected organization web URLs still fail validation and the error includes those recovery options.

Written by the indexing model from the issue text.

Description

mcp-feedback-pattern

Agents pass an organization's web URL (https://<org>.sentry.io, the webUrl from find_organizations) as regionUrl. The SSRF allowlist rightly rejects it, but the error only lists the allowed domains. It doesn't say the agent passed the wrong URL or that omitting regionUrl works, so agents retry with a guessed region or give up.

Where

  • packages/mcp-core/src/internal/tool-helpers/validate-region-url.ts (~L58-65) throws Invalid regionUrl. The domain '<org>.sentry.io' is not allowed. Allowed domains are: sentry.io, us.sentry.io, de.sentry.io with no next step.
  • ParamRegionUrl (packages/mcp-core/src/schema.ts ~L184-186) and find_organizations already describe regionUrl and webUrl correctly, so this is about recovery, not the description.

Expected

The rejection keeps the allowlist (no SSRF change) and tells the agent to pass the regionUrl from find_organizations, not the webUrl, or to omit regionUrl.

Reports

  • MCP-SERVER-GX7 (hosted, org-scoped URL): get_event_stacktrace rejected the org's web URL; the agent then guessed https://us.sentry.io and hit a 401 (also counted on #2495).
  • MCP-SERVER-GYN (hosted, org-scoped URL): get_issue_details and get_replay_details rejected the org's web URL as regionUrl; omitting regionUrl worked.

Report count: 2

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_d3a7b079a597fb34fdd749c9c82402a4.

--

View Session [Sentry]

Dominant language
TypeScript
Stars
975
Forks
189
Avg merge
1d 2h
Merged PRs (30d)
571

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/toolkit

All issues in getsentry/toolkit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.