Home / Servers / Sentry API / retrieve_trace_item_statistics

Compute statistics, such as attribute value distributions, over the trace items

An MCP tool from the Sentry API server, hosted on mcp.hjlabs.in.

Compute statistics, such as attribute value distributions, over the trace items (spans or occurrences) matching the… [GET /api/0/organizations/{organization_id_or_slug}/trace-items/stats/]

Name on the gateway: sentry_api__retrieve_trace_item_statistics · read-only.

Parameters

NameTypeDescription
organization_id_or_slug requiredstringThe ID or slug of the organization the resource belongs to.
statsType requiredarrayThe statistics to compute over the matching trace items.
projectarrayThe IDs or slugs of projects to filter by. Project slugs are unique within…
environmentarrayThe name of environments to filter by.
statsPeriodstringThe period of time for the query, will override the start & end parameters, a…
startstringThe start of the period of time for the query, expected in ISO-8601 format.…
endstringThe end of the period of time for the query, expected in ISO-8601 format. For…
querystringSentry search syntax to filter trace items before computing statistics.
substringMatchstringRestrict results to attribute names containing this substring (case-sensitive).
traceItemsLimitintegerMaximum number of trace items to sample when computing statistics. Defaults to…
itemTypespans | occurrencesThe trace item dataset to compute statistics for. Defaults to spans. * spans *…
cursorstringA pointer to the last object fetched and its sort order; used to retrieve the…

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "sentry_api__retrieve_trace_item_statistics",
  "arguments": {
    "organization_id_or_slug": "…",
    "statsType": []
  }
}

Or connect the Sentry API server directly, which lists 272 tools including this one:

Run in your terminal
claude mcp add --transport http hj-sentry-api https://mcp.hjlabs.in/mcp/sentry-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the compute statistics, such as attribute value distributions, over the trace items tool with organization_id_or_slug set to ….

More from Sentry API