Skip to main content
Glama

sentry_get_organization_stats

Extract detailed organization statistics for monitoring error handling, including received, rejected, and blacklisted data, over specified time intervals with customizable resolution, for effective application health analysis.

Instructions

Get organization statistics

Input Schema

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

Implementation Reference

  • Handler for the sentry_get_organization_stats tool. Extracts input parameters, checks for API client, fetches stats via API client, and returns 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)}`, }, ], }; }
  • Input schema defining parameters for the sentry_get_organization_stats tool, including required 'stat' and optional date range and resolution.
    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"], },
  • src/index.ts:456-483 (registration)
    Tool registration entry in the ListTools response, specifying name, description, and input schema.
    { 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"], }, },
  • Helper method in SentryAPIClient that constructs and sends the HTTP request to the Sentry organization stats endpoint.
    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