Skip to main content
Glama
Leee62

Sentry Issues MCP

by Leee62

get_project_events

Retrieve issue events from Sentry projects using organization and project identifiers. Control output format to manage token usage effectively.

Instructions

get issue events by inputting sentry organization id or slug and sentry project name or slug

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organization_id_or_slugNosentry organization id or slug, it can be undefined
project_id_or_slugNosentry project name or slug, it can be undefined
modeNomode for output, it can be undefined, it used to control LLM token usagetiny

Implementation Reference

  • The MCP tool handler function for 'get_project_events'. It fetches events using the helper fetchSentryEvents, processes the output based on the 'mode' parameter ('tiny' summarizes to id/title/dateCreated, 'huge' full data), handles errors, and returns MCP-formatted content.
    async ({ organization_id_or_slug, project_id_or_slug, mode }) => {
      const eventsData = await fetchSentryEvents<
        { id: string; title: string; dateCreated: string }[]
      >(organization_id_or_slug, project_id_or_slug);
    
      if (!eventsData) {
        return {
          content: [
            {
              type: "text",
              text: "Failed to Get Issue",
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              mode === "tiny"
                ? eventsData.map(({ id, title, dateCreated }) => ({
                    id,
                    title,
                    dateCreated,
                  }))
                : eventsData
            ),
          },
        ],
      };
    }
  • Input schema for the 'get_project_events' tool using Zod, defining optional organization/project slugs (defaulting to env vars) and mode enum.
    {
      organization_id_or_slug: z
        .string()
        .optional()
        .default(process.env.SENTRY_ORG as string)
        .describe("sentry organization id or slug, it can be undefined"),
      project_id_or_slug: z
        .string()
        .optional()
        .default(process.env.SENTRY_PROJ as string)
        .describe("sentry project name or slug, it can be undefined"),
      mode: z
        .enum(["tiny", "huge"])
        .optional()
        .default("tiny")
        .describe(
          "mode for output, it can be undefined, it used to control LLM token usage"
        ),
    },
  • src/index.ts:97-152 (registration)
    Registration of the 'get_project_events' tool on the MCP server using server.tool(), including description, input schema, and execution handler.
    server.tool(
      "get_project_events",
      "get issue events by inputting sentry organization id or slug and sentry project name or slug",
      {
        organization_id_or_slug: z
          .string()
          .optional()
          .default(process.env.SENTRY_ORG as string)
          .describe("sentry organization id or slug, it can be undefined"),
        project_id_or_slug: z
          .string()
          .optional()
          .default(process.env.SENTRY_PROJ as string)
          .describe("sentry project name or slug, it can be undefined"),
        mode: z
          .enum(["tiny", "huge"])
          .optional()
          .default("tiny")
          .describe(
            "mode for output, it can be undefined, it used to control LLM token usage"
          ),
      },
      async ({ organization_id_or_slug, project_id_or_slug, mode }) => {
        const eventsData = await fetchSentryEvents<
          { id: string; title: string; dateCreated: string }[]
        >(organization_id_or_slug, project_id_or_slug);
    
        if (!eventsData) {
          return {
            content: [
              {
                type: "text",
                text: "Failed to Get Issue",
              },
            ],
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                mode === "tiny"
                  ? eventsData.map(({ id, title, dateCreated }) => ({
                      id,
                      title,
                      dateCreated,
                    }))
                  : eventsData
              ),
            },
          ],
        };
      }
    );
  • Supporting utility function fetchSentryEvents that makes the API call to retrieve Sentry project events, used by the tool handler.
    /** get sentry events */
    export async function fetchSentryEvents<T>(
      organization_id_or_slug: string,
      project_id_or_slug: string
    ): Promise<T | null> {
      try {
        const issueRes = await fetch(
          `https://${process.env.SENTRY_HOST}/api/0/projects/${organization_id_or_slug}/${project_id_or_slug}/events/`,
          {
            method: "GET",
            headers: {
              Authorization: `Bearer ${process.env.SENTRY_USER_TOKEN}`,
            },
          }
        );
    
        if (!issueRes.ok) {
          throw new Error(`HTTP error! status: ${issueRes.status}`);
        }
        return (await issueRes.json()) as T;
      } catch (error) {
        console.error("Error making request:", error);
        return null;
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but provides minimal behavioral context. It mentions what inputs to provide but doesn't describe what 'get issue events' actually returns (list of events? what format?), pagination behavior, authentication requirements, rate limits, or error conditions. For a tool with 3 parameters and no output schema, this is insufficient.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point without unnecessary words. However, it could be slightly more structured by separating the core purpose from the parameter requirements for better readability.

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 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'issue events' are, what format they're returned in, whether there are pagination considerations, or how the 'mode' parameter affects the output. The agent would struggle to understand what to expect from this tool invocation.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description mentions organization and project inputs but adds no additional semantic context beyond what's in the schema. The 'mode' parameter with its 'tiny'/'huge' enum values controlling LLM token usage is only explained in the schema, not the description.

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

Purpose4/5

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

The description clearly states the action ('get issue events') and the required inputs (organization and project identifiers), making the purpose understandable. However, it doesn't differentiate from the sibling tool 'get_single_event' - we don't know if this tool returns multiple events vs a single event, or how they differ in scope.

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 the sibling 'get_single_event'. There's no mention of prerequisites, appropriate contexts, or alternative approaches. The user must infer usage from the tool name alone.

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/Leee62/sentry-issues-mcp'

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