Skip to main content
Glama
zereight

Sentry MCP Server

get_sentry_issue

Retrieve detailed information about a specific Sentry error tracking issue using its ID or URL to analyze and resolve application errors.

Instructions

Get details for a specific Sentry issue using its ID or URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issue_id_or_urlYesThe Sentry issue ID or the full URL of the issue page

Implementation Reference

  • Main execution logic for the 'get_sentry_issue' tool. Validates the input issue ID or URL using parseSentryIssueInput helper, fetches the issue details from the Sentry API, and returns the data as formatted JSON or an error message.
    // --- Start of get_sentry_issue logic ---
    
    const issueInput = request.params.arguments?.issue_id_or_url;
    
    if (typeof issueInput !== 'string') {
      throw new McpError(
        ErrorCode.InvalidParams,
        'Invalid arguments: issue_id_or_url must be a string.'
      );
    }
    
    const parsedInput = parseSentryIssueInput(issueInput);
    
    if (!parsedInput) {
      throw new McpError(
        ErrorCode.InvalidParams,
        `Invalid Sentry issue ID or URL format: ${issueInput}`
      );
    }
    
    const { issueId } = parsedInput;
    
    try {
      // Call Sentry API to get issue info
      const response = await this.axiosInstance.get(`issues/${issueId}/`);
    
      // On success, return issue data as JSON string
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response.data, null, 2), // Pretty-print
          },
        ],
      };
    } catch (error) {
      let errorMessage = 'Failed to fetch Sentry issue.';
      if (axios.isAxiosError(error)) {
        errorMessage = `Sentry API error: ${error.response?.status} ${error.response?.statusText}. ${JSON.stringify(error.response?.data)}`;
        console.error("Sentry API Error Details:", error.response?.data);
      } else if (error instanceof Error) {
          errorMessage = error.message;
      }
       console.error("Error fetching Sentry issue:", error);
      // On failure, return error message
      return {
        content: [
          {
            type: 'text',
            text: errorMessage,
          },
        ],
        isError: true,
      };
    }
  • Input schema defining the parameters for the 'get_sentry_issue' tool, requiring a string 'issue_id_or_url'.
    inputSchema: {
      type: 'object',
      properties: {
        issue_id_or_url: {
          type: 'string',
          description: 'The Sentry issue ID or the full URL of the issue page',
        },
      },
      required: ['issue_id_or_url'],
    },
  • src/index.ts:116-129 (registration)
    Tool registration in the listTools response, including name, description, and input schema for 'get_sentry_issue'.
    {
      name: 'get_sentry_issue',
      description: 'Get details for a specific Sentry issue using its ID or URL',
      inputSchema: {
        type: 'object',
        properties: {
          issue_id_or_url: {
            type: 'string',
            description: 'The Sentry issue ID or the full URL of the issue page',
          },
        },
        required: ['issue_id_or_url'],
      },
    },
  • Helper function to parse and validate Sentry issue input, extracting numeric issue ID from plain ID or URL format.
    function parseSentryIssueInput(input: string): { issueId: string } | null {
      try {
        // Check if it's a URL format
        if (input.startsWith('http://') || input.startsWith('https://')) {
          const url = new URL(input);
          const pathParts = url.pathname.split('/');
          // e.g., /issues/6380454530/
          const issuesIndex = pathParts.indexOf('issues');
          if (issuesIndex !== -1 && pathParts.length > issuesIndex + 1) {
            const issueId = pathParts[issuesIndex + 1];
            if (/^\d+$/.test(issueId)) { // Check if it consists only of digits
              return { issueId };
            }
          }
        } else if (/^\d+$/.test(input)) { // Check if it's a simple ID format
          return { issueId: input };
        }
      } catch (e) {
        // Ignore URL parsing errors, etc.
        console.error("Error parsing Sentry input:", e);
      }
      return null;
    }
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. It states the action ('Get details') but doesn't describe what details are returned, potential errors (e.g., invalid ID), authentication requirements, rate limits, or whether it's a read-only operation. This leaves significant gaps in understanding the tool's behavior beyond the basic purpose.

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 front-loads the core purpose ('Get details for a specific Sentry issue') and includes essential parameter information without redundancy. Every part of the sentence earns its place, making it highly concise and well-structured.

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 the lack of annotations and output schema, the description is incomplete for a tool that retrieves detailed data. It doesn't explain what 'details' include (e.g., issue metadata, stack traces, assignee), potential response formats, or error handling. For a read operation with no structured output documentation, this leaves the agent with insufficient context to use the tool effectively.

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 fully documents the single parameter 'issue_id_or_url'. The description adds minimal value by restating that it accepts 'ID or URL', but doesn't provide additional context like format examples, URL structure, or how to distinguish between ID and URL inputs. Baseline 3 is appropriate as 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 verb ('Get details') and resource ('for a specific Sentry issue'), making the purpose immediately understandable. It distinguishes from sibling tools like 'list_project_issues' by specifying retrieval of a single issue rather than listing multiple. However, it doesn't explicitly contrast with 'get_event_details' or 'list_organization_projects', preventing a perfect score.

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_event_details' or 'list_project_issues'. It mentions the parameter ('issue ID or URL') but doesn't clarify scenarios where this tool is preferred over siblings, such as needing detailed issue metadata versus event-level data or bulk listings.

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

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