Skip to main content
Glama

sentry_get_organization_stats

Retrieve organization statistics from Sentry to monitor error volumes, track rejected events, and analyze blacklisted data over specified time periods.

Instructions

Get organization statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statYesType of statistic
sinceNoStart date (ISO format or timestamp)
untilNoEnd date (ISO format or timestamp)
resolutionNoTime resolution

Implementation Reference

  • Tool schema definition in the ListTools response, including input schema with parameters: stat (required, enum: received/rejected/blacklisted), optional since/until dates, and resolution (10s/1h/1d).
    { name: "sentry_get_organization_stats", description: "Get organization statistics", inputSchema: { type: "object", properties: { stat: { type: "string", enum: ["received", "rejected", "blacklisted"], description: "Type of statistic", }, since: { type: "string", description: "Start date (ISO format or timestamp)", }, until: { type: "string", description: "End date (ISO format or timestamp)", }, resolution: { type: "string", enum: ["10s", "1h", "1d"], description: "Time resolution", }, }, required: ["stat"], }, },
  • MCP tool handler in the CallToolRequestHandler switch statement. Validates API client, extracts input parameters, calls SentryAPIClient.getOrganizationStats, and returns the stats as a formatted text response.
    case "sentry_get_organization_stats": { if (!apiClient) { throw new Error("Sentry API client not initialized. Provide auth token."); } const { stat, since, until, resolution } = args as any; const stats = await apiClient.getOrganizationStats(stat, { since, until, resolution, }); return { content: [ { type: "text", text: `Organization ${stat} stats:\n${JSON.stringify(stats, null, 2)}`, }, ], }; }
  • Helper method in SentryAPIClient class that constructs the Sentry API endpoint for organization stats (/organizations/{org}/stats/{stat}/) with query params and performs the authenticated HTTP GET request.
    async getOrganizationStats(stat: string, params?: any) { const queryParams = params ? '?' + new URLSearchParams(params).toString() : ''; return this.request(`/organizations/${this.org}/stats/${stat}/${queryParams}`); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/diegofornalha/sentry-mcp-cursor'

If you have feedback or need assistance with the MCP directory API, please join our Discord server