Skip to main content
Glama
diegofornalha

MCP Sentry para Cursor

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}`);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. 'Get organization statistics' implies a read-only operation but doesn't specify authentication requirements, rate limits, pagination behavior, error conditions, or what format the statistics are returned in. For a tool with 4 parameters and no output schema, this leaves significant behavioral gaps unaddressed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words with no wasted language. It's front-loaded with the core purpose and contains no unnecessary elaboration. While potentially too brief for completeness, as a standalone statement it achieves maximum efficiency without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what 'organization statistics' means in practice, what format the data returns, or how the parameters interact. The agent would need to infer too much from the parameter schema alone, especially regarding the statistical output that isn't documented anywhere.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage with clear parameter documentation, so the description adds no parameter semantics beyond what the schema already provides. The description doesn't explain the relationship between parameters (e.g., that 'since' and 'until' define a time range for the statistic) or provide usage examples. This meets the baseline for high schema coverage but doesn't add value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get organization statistics' clearly states the verb ('Get') and resource ('organization statistics'), which is better than a tautology. However, it's vague about what specific statistics are available and doesn't differentiate from sibling tools like sentry_list_organization_replays or sentry_list_projects that also retrieve organization-level data. The description lacks specificity about the statistical nature of the data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this statistical view is preferable over other data retrieval tools like sentry_list_issues or sentry_get_event, nor does it specify any prerequisites or contextual constraints for usage. The agent receives no usage direction beyond the basic purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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