Skip to main content
Glama
Leee62

Sentry Issues MCP

by Leee62

get_single_event

Retrieve detailed information about a specific Sentry issue event by providing its URL or ID, enabling targeted debugging and analysis.

Instructions

get issue event by inputting sentry issue event url or sentry issue event id

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
url_or_idYessentry issue event url or sentry issue event id
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

  • Handler function that parses the input URL or ID to extract event ID, fetches the Sentry event using fetchSentryEvent helper, and returns the data as JSON with optional truncation based on mode.
    async ({ url_or_id, organization_id_or_slug, project_id_or_slug, mode }) => {
      let EVENT_ID = "";
    
      if (url_or_id.includes("http") || url_or_id.includes("https")) {
        EVENT_ID = url_or_id.match(/events\/([a-f0-9]+)/)?.[1] || "";
      } else {
        EVENT_ID = url_or_id;
      }
    
      if (!EVENT_ID) {
        return {
          content: [
            {
              type: "text",
              text: "Invalid Event ID",
            },
          ],
        };
      }
    
      const eventEventData = await fetchSentryEvent<{
        entries: any[];
      }>(EVENT_ID, organization_id_or_slug, project_id_or_slug);
    
      if (!eventEventData) {
        return {
          content: [
            {
              type: "text",
              text: "Failed to Get Event",
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              mode === "tiny" ? eventEventData.entries : eventEventData
            ),
          },
        ],
      };
    }
  • Zod schema defining the input parameters for the get_single_event tool: url_or_id (required), organization/project ids (optional with defaults), and mode (tiny/huge).
    {
      url_or_id: z
        .string()
        .describe("sentry issue event url or sentry issue event id"),
      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:23-94 (registration)
    MCP server.tool registration for 'get_single_event' tool, specifying name, description, input schema, and handler function.
    server.tool(
      "get_single_event",
      "get issue event by inputting sentry issue event url or sentry issue event id",
      {
        url_or_id: z
          .string()
          .describe("sentry issue event url or sentry issue event id"),
        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 ({ url_or_id, organization_id_or_slug, project_id_or_slug, mode }) => {
        let EVENT_ID = "";
    
        if (url_or_id.includes("http") || url_or_id.includes("https")) {
          EVENT_ID = url_or_id.match(/events\/([a-f0-9]+)/)?.[1] || "";
        } else {
          EVENT_ID = url_or_id;
        }
    
        if (!EVENT_ID) {
          return {
            content: [
              {
                type: "text",
                text: "Invalid Event ID",
              },
            ],
          };
        }
    
        const eventEventData = await fetchSentryEvent<{
          entries: any[];
        }>(EVENT_ID, organization_id_or_slug, project_id_or_slug);
    
        if (!eventEventData) {
          return {
            content: [
              {
                type: "text",
                text: "Failed to Get Event",
              },
            ],
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                mode === "tiny" ? eventEventData.entries : eventEventData
              ),
            },
          ],
        };
      }
    );
  • Helper function fetchSentryEvent that performs the actual API fetch to retrieve a single Sentry event by ID using the provided organization, project, and auth token.
    /** get sentry event by <ID> */
    export async function fetchSentryEvent<T>(
      eventId: string,
      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/${eventId}/`,
          {
            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?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool retrieves an issue event but doesn't describe what an 'issue event' contains, whether this is a read-only operation, potential error conditions, or any performance considerations. The description is minimal and lacks behavioral context.

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 a single, efficient sentence with zero wasted words. It's appropriately sized and front-loaded, directly stating the tool's core functionality without unnecessary elaboration.

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?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what an 'issue event' is, what data it returns, or how the 'mode' parameter affects output. For a tool with 4 parameters and no structured output documentation, more context is needed to be fully helpful.

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 'url_or_id' but doesn't add meaning beyond what the schema provides for parameters like 'mode' with its enum values or optional fields. Baseline 3 is appropriate when the schema does the heavy lifting.

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 tool's purpose: 'get issue event by inputting sentry issue event url or sentry issue event id'. It specifies the verb ('get'), resource ('issue event'), and required input format, though it doesn't explicitly differentiate from the sibling tool 'get_project_events'.

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 like 'get_project_events'. It states what the tool does but offers no context about appropriate use cases, prerequisites, or exclusions.

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