Skip to main content
Glama
zereight

Sentry MCP Server

list_project_issues

Retrieve and filter issues for a Sentry project to monitor errors, track unresolved problems, and manage debugging tasks with customizable search queries and time periods.

Instructions

List issues for a specific project, with optional filtering.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
organization_slugNoThe slug of the organization the project belongs to.
project_slugYesThe slug of the project to list issues for.
queryNoSentry search query to filter issues (e.g., "is:unresolved", "assignee:me"). Optional.
statsPeriodNoTime period for statistics (e.g., "24h", "14d", "auto"). Optional.
cursorNoPagination cursor for fetching next/previous page. Optional.

Implementation Reference

  • Handler for the 'list_project_issues' tool. Extracts parameters, validates project_slug, makes API call to Sentry for project issues with optional filters and pagination, parses Link header for pagination info, returns JSON or error.
    case 'list_project_issues': {
      let { organization_slug, project_slug, query, statsPeriod, cursor } = 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
    
      // 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.');
      }
    
      // Configure parameters for API request
      const apiParams: Record<string, string> = {};
      if (typeof query === 'string' && query.length > 0) apiParams.query = query;
      if (typeof statsPeriod === 'string' && statsPeriod.length > 0) apiParams.statsPeriod = statsPeriod;
      if (typeof cursor === 'string' && cursor.length > 0) apiParams.cursor = cursor;
    
      try {
        const response = await this.axiosInstance.get(
          `projects/${organization_slug}/${project_slug}/issues/`,
          { params: apiParams }
        );
    
        // Return result including pagination info (Link header parsing needed)
        const linkHeader = response.headers['link']; // Axios might return header keys in lowercase
        const paginationInfo = parseLinkHeader(linkHeader); // Link header parsing function needed
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                issues: response.data,
                pagination: paginationInfo, // Add parsed pagination info
              }, null, 2),
            },
          ],
        };
      } catch (error) {
         let errorMessage = 'Failed to list Sentry project issues.';
         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 listing Sentry project issues:", error);
        return {
          content: [ { type: 'text', text: errorMessage } ],
          isError: true,
        };
      }
      break; // End case
  • src/index.ts:139-168 (registration)
    Registration of the 'list_project_issues' tool in the MCP ListTools response, including name, description, and detailed input schema.
    {
      name: 'list_project_issues',
      description: 'List issues for a specific project, with optional filtering.',
      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 to list issues for.',
          },
          query: {
            type: 'string',
            description: 'Sentry search query to filter issues (e.g., "is:unresolved", "assignee:me"). Optional.',
          },
          statsPeriod: {
            type: 'string',
            description: 'Time period for statistics (e.g., "24h", "14d", "auto"). Optional.',
          },
          cursor: {
             type: 'string',
             description: 'Pagination cursor for fetching next/previous page. Optional.',
          }
        },
        required: ['project_slug'], // Changed project_slug to required
      },
    },
  • Helper function parseLinkHeader used in the handler to parse Sentry API's Link header for pagination information (next/prev cursors).
    function parseLinkHeader(header: string | undefined): Record<string, string> {
        if (!header) return {};
    
        const links: Record<string, string> = {};
        const parts = header.split(',');
    
        parts.forEach(part => {
            const section = part.split(';');
            if (section.length < 2) return;
    
            const urlMatch = section[0].match(/<(.*)>/);
            if (!urlMatch) return;
            const url = urlMatch[1];
    
            const params: Record<string, string> = {};
            section.slice(1).forEach(paramPart => {
                const param = paramPart.trim().split('=');
                if (param.length === 2) {
                    params[param[0]] = param[1].replace(/"/g, '');
                }
            });
    
            if (params.rel && params.results === 'true' && params.cursor) {
                 links[params.rel] = params.cursor; // Use rel value (next or prev) as key
            }
        });
        return links;
    }
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 'list issues' but doesn't cover critical aspects like pagination behavior (implied by 'cursor' parameter but not explained), rate limits, authentication needs, or what the return format looks like (no output schema). This leaves significant gaps for an agent to understand the tool's behavior.

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 with no wasted words. It's appropriately sized for a listing tool, though it could be slightly more informative without sacrificing brevity.

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 complexity of a 5-parameter tool with no annotations and no output schema, the description is insufficient. It doesn't explain the return values, pagination behavior, or error conditions. While the schema covers parameters well, the overall context for proper tool invocation and result interpretation is lacking.

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?

The description adds minimal value beyond the input schema, which has 100% coverage with clear descriptions for all 5 parameters. It mentions 'optional filtering' which aligns with the 'query' and 'statsPeriod' parameters, but doesn't provide additional context or examples beyond what's in the schema. 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 'list' and the resource 'issues for a specific project', making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_sentry_issue' or 'list_organization_projects', which might handle similar data, so it lacks explicit sibling distinction.

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 mentions 'optional filtering' but provides no guidance on when to use this tool versus alternatives like 'get_sentry_issue' or 'list_organization_projects'. There's no context on prerequisites, exclusions, or specific scenarios for application.

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