Repository navigation
search_events fails on self-hosted Sentry (25.8.0): /events/validate/ returns 404 #1497
Description
Summary
search_events always fails on self-hosted Sentry with an HTTP 404, because the tool unconditionally calls the event-validation endpoint GET /api/0/organizations/{organizationSlug}/events/validate/, which is not present on self-hosted Sentry 25.8.0.
The actual events endpoint GET /api/0/organizations/{organizationSlug}/events/ works fine, so only the pre-flight validation gate breaks the tool.
Environment
@sentry/mcp-serverversion: 0.42.0 (currentlateston npm)- Transport:
stdio - Node: v24.18.0
- Sentry: self-hosted 25.8.0
- Command:
npx @sentry/mcp-server@latest --access-token=*** --host=sentry.example.com- Auth token scopes:
org:read,project:read,project:write,team:read,team:write,event:write
Steps to reproduce
- Run the MCP server in stdio mode against a self-hosted Sentry instance (Sentry 25.8.0).
- Call the
search_eventstool, for example:
{ "organizationSlug": "sentry", "dataset": "errors", "period": "1h", "fields": ["count()"] }- Observe the error.
Actual result
**Input Error**
There was an HTTP 404 error with your request to the Sentry API.
API error (404): API request failed: Not Found
. Please verify the parameters are correct.
Other tools (find_organizations, find_projects, search_issues, get_sentry_resource) work correctly against the same instance.
Root cause
The search_events handler calls validateEventsSearch(...) before executing the search, regardless of whether an embedded LLM/agent provider is configured. That validation issues a request to the events/validate/ path.
Reproduced directly against the same instance with a valid token:
GET /api/0/organizations/sentry/events/validate/?dataset=errors&query=&field=count()&statsPeriod=1h
-> 404 Not Found
GET /api/0/organizations/sentry/events/
-> 200 OK (endpoint works)
GET /api/0/organizations/sentry/events/?field=count()&statsPeriod=1h
-> 200 OK -> {"data":[{"count()":4514}]}
So the events/validate/ endpoint simply does not exist on this self-hosted deployment/version, and the tool has no fallback: if (!lastValidation.valid) throw ... means a 404 during validation surfaces as an "Input Error" to the user.
Code path (from the published dist/index.cjs): the search_events handler calls validateEventsSearch(apiService, {...}); the underlying validateEvents method builds GET /organizations/${organizationSlug}/events/validate/?.... There is no self-hosted capability check around it.
Expected behavior
One of:
search_eventsshould skip (or gracefully degrade) the validation step when theevents/validate/endpoint returns 404 / is unavailable (e.g. on self-hosted), and still run the actual search against/events/.- Or the tool should detect that validation is unsupported on the target host and proceed without it.
- At minimum, a 404 from the validation endpoint should not be reported as a user-facing "Input Error" that blocks an otherwise-working search.
Notes
- The self-hosted
--hostskill filtering already dropsseer; there appears to be no equivalent handling for endpoints that self-hosted Sentry does not expose. - Direct API access to
/events/works, so this is purely an MCP-side validation incompatibility, not a token/permission issue.
Activity
linear-code commentedon Oct 14, 2026
MCP-1084
EngRajabi commentedon Oct 14, 2026
Submitted a fix: #1499
Root cause confirmed: \�alidateEvents\ calls /events/validate/\ and treats the 404 as fatal. The fix returns
ull\ when the endpoint is unavailable and skips the validation gate so the search runs. Verified end-to-end against a self-hosted Sentry 25.8.0 — the same call now returns data instead of the 404.