Skip to main content
Glama
zereight

Sentry MCP Server

get_event_details

Retrieve detailed information for a specific error event in Sentry to analyze and debug issues using organization, project, and event identifiers.

Instructions

Get details for a specific event within a project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organization_slugNoThe slug of the organization the project belongs to.
project_slugYesThe slug of the project the event belongs to.
event_idYesThe ID of the event to retrieve.

Implementation Reference

  • Handler for 'get_event_details' tool: validates inputs (project_slug required, event_id 32-hex), defaults org_slug, calls Sentry API /projects/{org}/{project}/events/{event}/, returns JSON response or error.
    case 'get_event_details': {
      let { organization_slug, project_slug, event_id } = request.params.arguments ?? {};
    
       // If user doesn't provide slug, use default value read from environment variable
       organization_slug = typeof organization_slug === 'string' ? organization_slug : this.defaultOrgSlug;
       // Removed project_slug default assignment
    
      // Added project_slug required check
      if (typeof project_slug !== 'string' || project_slug.length === 0) {
         throw new McpError(ErrorCode.InvalidParams, 'Missing or invalid argument: project_slug must be a non-empty string.');
      }
      // event_id required and format check
      if (typeof event_id !== 'string') { // First check if it's string type
        throw new McpError(ErrorCode.InvalidParams, 'Missing or invalid argument: event_id must be a string.');
      }
      // Event ID validation (32-char hex) - event_id is now guaranteed to be string type
      const eventIdRegex = /^[a-f0-9]{32}$/i;
      if (!eventIdRegex.test(event_id)) {
        throw new McpError(ErrorCode.InvalidParams, `Invalid event_id format: '${event_id}'. Please provide a valid 32-character hexadecimal Sentry Event ID. You can get this by clicking 'Copy Event ID' in Sentry.`);
      }
    
      try {
        const response = await this.axiosInstance.get(
          `projects/${organization_slug}/${project_slug}/events/${event_id}/`
        );
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response.data, null, 2),
            },
          ],
        };
      } catch (error) {
         let errorMessage = 'Failed to fetch Sentry event details.';
         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 event details:", error);
        return {
          content: [ { type: 'text', text: errorMessage } ],
          isError: true,
        };
      }
      break; // End case
  • src/index.ts:169-190 (registration)
    Tool registration in ListToolsRequestSchema response, defining name, description, and input schema with required event_id and project_slug, optional organization_slug.
    {
      name: 'get_event_details',
      description: 'Get details for a specific event within a project.',
      inputSchema: {
        type: 'object',
        properties: {
          organization_slug: {
            type: 'string',
            description: 'The slug of the organization the project belongs to.',
          },
          project_slug: {
            type: 'string',
            description: 'The slug of the project the event belongs to.',
          },
          event_id: {
            type: 'string',
            description: 'The ID of the event to retrieve.',
          },
        },
        required: ['event_id', 'project_slug'], // Changed project_slug to required
      },
    },
  • Input schema definition for 'get_event_details' tool, specifying properties and required fields.
    inputSchema: {
      type: 'object',
      properties: {
        organization_slug: {
          type: 'string',
          description: 'The slug of the organization the project belongs to.',
        },
        project_slug: {
          type: 'string',
          description: 'The slug of the project the event belongs to.',
        },
        event_id: {
          type: 'string',
          description: 'The ID of the event to retrieve.',
        },
      },
      required: ['event_id', 'project_slug'], // Changed project_slug to required
    },

Tool Definition Quality

Score is being calculated. Check back soon.

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