Skip to main content
Glama
diegofornalha

MCP Sentry para Cursor

sentry_get_issue

Retrieve and analyze Sentry issues by providing an issue URL or ID to monitor application errors and performance.

Instructions

Retrieve and analyze a Sentry issue. Accepts issue URL or ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
issueIdYesIssue ID or URL

Implementation Reference

  • The main handler for the 'sentry_get_issue' tool within the MCP server request handler switch statement. It validates the API client, extracts the issueId from arguments, fetches the issue using apiClient.getIssue, and formats a detailed text response with key issue properties.
    case "sentry_get_issue": {
      if (!apiClient) {
        throw new Error("Sentry API client not initialized. Provide auth token.");
      }
      
      const { issueId } = args as any;
      const issue = await apiClient.getIssue(issueId);
      
      return {
        content: [
          {
            type: "text",
            text: `Issue ${issueId} details:\n` +
              `- Title: ${issue.title}\n` +
              `- Short ID: ${issue.shortId}\n` +
              `- Status: ${issue.status}\n` +
              `- Level: ${issue.level}\n` +
              `- Platform: ${issue.platform || 'N/A'}\n` +
              `- First seen: ${issue.firstSeen}\n` +
              `- Last seen: ${issue.lastSeen}\n` +
              `- Event count: ${issue.count}\n` +
              `- User count: ${issue.userCount}`,
          },
        ],
      };
    }
  • Input schema definition for the 'sentry_get_issue' tool, specifying a required 'issueId' string parameter. This is part of the tools array used for MCP tool registration.
      name: "sentry_get_issue",
      description: "Retrieve and analyze a Sentry issue. Accepts issue URL or ID.",
      inputSchema: {
        type: "object",
        properties: {
          issueId: {
            type: "string",
            description: "Issue ID or URL",
          },
        },
        required: ["issueId"],
      },
    },
  • src/index.ts:615-690 (registration)
    The 'sentry_get_issue' tool is registered in the MCP server's tools array, which is passed to the server for tool discovery and invocation.
        {
          name: "sentry_get_issue",
          description: "Retrieve and analyze a Sentry issue. Accepts issue URL or ID.",
          inputSchema: {
            type: "object",
            properties: {
              issueId: {
                type: "string",
                description: "Issue ID or URL",
              },
            },
            required: ["issueId"],
          },
        },
        {
          name: "sentry_list_organization_replays",
          description: "List replays from a Sentry organization. Monitor user sessions, interactions, errors and experience issues.",
          inputSchema: {
            type: "object",
            properties: {
              project: {
                type: "string",
                description: "Project ID or slug",
              },
              limit: {
                type: "number",
                description: "Number of replays to return",
                default: 50,
              },
              query: {
                type: "string",
                description: "Search query",
              },
            },
            required: [],
          },
        },
        {
          name: "sentry_setup_project",
          description: "Set up Sentry for a project returning a DSN and instructions for setup.",
          inputSchema: {
            type: "object",
            properties: {
              projectSlug: {
                type: "string",
                description: "Project slug/identifier",
              },
              platform: {
                type: "string",
                description: "Platform for installation instructions",
                default: "javascript",
              },
            },
            required: ["projectSlug"],
          },
        },
        {
          name: "sentry_search_errors_in_file",
          description: "Search for Sentry errors occurring in a specific file. Find all issues related to a particular file path or filename.",
          inputSchema: {
            type: "object",
            properties: {
              projectSlug: {
                type: "string",
                description: "Project slug/identifier",
              },
              filename: {
                type: "string",
                description: "File path or filename to search for",
              },
            },
            required: ["projectSlug", "filename"],
          },
        },
      ],
    };
  • Helper method in SentryAPIClient that performs the HTTP GET request to retrieve Sentry issue details by ID via the generic request method.
    async getIssue(issueId: string) {
      return this.request(`/issues/${issueId}/`);
    }
  • Generic private request method used by all API client methods, including getIssue, to make authenticated HTTP requests to Sentry API.
    private async request(endpoint: string, options: any = {}) {
      const url = `${this.baseUrl}${endpoint}`;
      const response = await fetch(url, {
        ...options,
        headers: {
          'Authorization': `Bearer ${this.authToken}`,
          'Content-Type': 'application/json',
          ...options.headers,
        },
      });
    
      if (!response.ok) {
        throw new Error(`Sentry API error: ${response.status} ${response.statusText}`);
      }
    
      return response.json();
    }

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