Skip to content

search_events fails on self-hosted Sentry (25.8.0): /events/validate/ returns 404 #1497

Open

Description

@EngRajabi

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-server version: 0.42.0 (current latest on 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

  1. Run the MCP server in stdio mode against a self-hosted Sentry instance (Sentry 25.8.0).
  2. Call the search_events tool, for example:
{ "organizationSlug": "sentry", "dataset": "errors", "period": "1h", "fields": ["count()"] }
  1. 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:

  1. search_events should skip (or gracefully degrade) the validation step when the events/validate/ endpoint returns 404 / is unavailable (e.g. on self-hosted), and still run the actual search against /events/.
  2. Or the tool should detect that validation is unsupported on the target host and proceed without it.
  3. 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 --host skill filtering already drops seer; 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

  1. linear-code commented on Oct 14, 2026

    @linear-code
  2. EngRajabi commented on Oct 14, 2026

    @EngRajabi
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions