Skip to content

Support metricsEnhanced dataset for transaction performance metrics #787

@jds2501-cs

Description

@jds2501-cs

Problem

The list_events tool currently hardcodes dataset to only ["errors", "logs", "spans"]:
https://github.com/getsentry/sentry-mcp/blob/main/packages/mcp-core/src/tools/list-events/index.ts#L67

However, on self-hosted Sentry instances with metrics-only configuration:

  • The spans dataset returns empty (no event-level span storage)
  • The Sentry UI uses dataset=metricsEnhanced to display transaction metrics
  • The metricsEnhanced dataset works perfectly via direct API calls

Impact

Users cannot access transaction performance data (p50, p75, p95, p99) through MCP, even though:

  1. The data exists and is visible in the UI
  2. The API endpoint supports it
  3. The list_events tool already supports aggregate functions

Proposed Solution

Add "metricsEnhanced" to the dataset enum in list-events/index.ts:

dataset: z
  .enum(["errors", "logs", "spans", "metricsEnhanced"])
  .default("errors")

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