Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_open_incidents

Retrieve and filter currently active incidents in New Relic to monitor system issues by priority and account.

Instructions

List all open incidents in your New Relic account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_account_idNoOptional New Relic account ID
priorityNoFilter by incident priority

Implementation Reference

  • Executes the core logic for listing open incidents in New Relic using a NerdGraph query on AI issues entities, with optional priority filtering and account ID validation.
    async listOpenIncidents(input: {
      target_account_id?: string;
      priority?: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW';
    }): Promise<Record<string, unknown>[]> {
      const accountId = input.target_account_id;
      if (!accountId) {
        throw new Error('Account ID must be provided');
      }
      if (!/^\d+$/.test(accountId)) {
        throw new Error('Invalid account ID format');
      }
    
      let filter = `accountId = '${accountId}' AND state = 'OPEN'`;
      if (input.priority) {
        filter += ` AND priority = '${input.priority}'`;
      }
    
      const query = `{
        actor {
          entitySearch(query: "${filter}") {
            results {
              entities {
                ... on AiIssuesEntity {
                  issues {
                    issues {
                      issueId
                      title
                      priority
                      state
                      createdAt
                      sources
                    }
                  }
                }
              }
            }
          }
        }
      }`;
    
      const response = await this.client.executeNerdGraphQuery<{
        actor?: {
          entitySearch?: {
            results?: { entities?: Array<{ issues?: { issues?: Record<string, unknown>[] } }> };
          };
        };
      }>(query);
      const entities = (response.data?.actor?.entitySearch?.results?.entities || []) as Array<{
        issues?: { issues?: Record<string, unknown>[] };
      }>;
    
      const incidents: Record<string, unknown>[] = [];
      entities.forEach((entity) => {
        if (entity.issues?.issues) {
          incidents.push(...entity.issues.issues);
        }
      });
    
      return incidents;
    }
  • Defines the tool schema: name, description, and inputSchema for parameters target_account_id (optional string) and priority (optional enum: CRITICAL|HIGH|MEDIUM|LOW).
    getIncidentsTool(): Tool {
      return {
        name: 'list_open_incidents',
        description: 'List all open incidents in your New Relic account',
        inputSchema: {
          type: 'object',
          properties: {
            target_account_id: {
              type: 'string',
              description: 'Optional New Relic account ID',
            },
            priority: {
              type: 'string',
              enum: ['CRITICAL', 'HIGH', 'MEDIUM', 'LOW'],
              description: 'Filter by incident priority',
            },
          },
        },
      };
    }
  • src/server.ts:68-106 (registration)
    Registers the tool by adding alertTool.getIncidentsTool() to the MCP server's tools Map.
      // Register all tools
      const tools = [
        nrqlTool.getToolDefinition(),
        apmTool.getListApplicationsTool(),
        entityTool.getSearchTool(),
        entityTool.getDetailsTool(),
        alertTool.getPoliciesTool(),
        alertTool.getIncidentsTool(),
        alertTool.getAcknowledgeTool(),
        syntheticsTool.getListMonitorsTool(),
        syntheticsTool.getCreateMonitorTool(),
        nerdGraphTool.getQueryTool(),
        // REST v2 tools
        restDeployments.getCreateTool(),
        restDeployments.getListTool(),
        restDeployments.getDeleteTool(),
        restApm.getListApplicationsTool(),
        restMetrics.getListMetricNamesTool(),
        restMetrics.getMetricDataTool(),
        restMetrics.getListApplicationHostsTool(),
        {
          name: 'get_account_details',
          description: 'Get New Relic account details',
          inputSchema: {
            type: 'object' as const,
            properties: {
              target_account_id: {
                type: 'string' as const,
                description: 'Optional account ID to get details for',
              },
            },
          },
        },
      ];
    
      tools.forEach((tool) => {
        this.tools.set(tool.name, tool);
      });
    }
  • MCP server dispatch case that invokes the AlertTool's listOpenIncidents handler with resolved account ID.
    case 'list_open_incidents':
      return await new AlertTool(this.client).listOpenIncidents({
        ...args,
        target_account_id: accountId,
      });
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 states 'List all open incidents' but doesn't cover aspects like pagination, rate limits, authentication needs, or what 'open' means operationally. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 that directly states the tool's purpose without any wasted words. It's front-loaded and appropriately sized for a simple listing tool, making it easy to understand at a glance.

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 listing incidents, no annotations, and no output schema, the description is incomplete. It doesn't explain what an 'incident' entails, the return format, or any limitations. For a tool that likely returns structured data, more context is needed to fully understand its usage.

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 input schema fully documents the two parameters (target_account_id and priority). The description doesn't add any meaning beyond this, such as explaining how filtering works or default behaviors. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 action ('List all open incidents') and the resource ('in your New Relic account'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'list_alert_policies' or 'search_entities' which might also list incidents or related items, so it doesn't reach the highest 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. It doesn't mention sibling tools like 'search_entities' that might offer similar functionality or specify use cases like filtering by status or urgency. Without any context or exclusions, it's a basic statement of purpose.

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/cloudbring/newrelic-mcp'

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