Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_open_incidents

Retrieve all open incidents in your New Relic account, with optional filtering by priority and account ID.

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

  • Schema definition for the 'list_open_incidents' tool, defining name, description, and inputSchema with optional target_account_id and priority filter.
    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',
            },
          },
        },
      };
    }
  • Handler function that executes the tool logic: builds a NerdGraph query filtering by accountId and state=OPEN (optionally by priority), executes it, and collects all incidents.
    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;
    }
  • src/server.ts:68-75 (registration)
    Registration of 'list_open_incidents' via alertTool.getIncidentsTool() in the tools map during server initialization.
    // Register all tools
    const tools = [
      nrqlTool.getToolDefinition(),
      apmTool.getListApplicationsTool(),
      entityTool.getSearchTool(),
      entityTool.getDetailsTool(),
      alertTool.getPoliciesTool(),
      alertTool.getIncidentsTool(),
  • Server-side handler dispatch routing the 'list_open_incidents' tool name to AlertTool.listOpenIncidents() with the 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?

Given no annotations, the description carries the full burden. It does not disclose that the operation is read-only, nor does it mention any authentication requirements, rate limits, or potential side effects. The word 'list' implies read-only but is not explicit.

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 concise sentence that front-loads the core purpose. However, it could be slightly expanded with minimal context without losing conciseness.

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?

No output schema is provided, and the description does not mention return format, pagination, or limits. For a list tool, this is a significant gap. The description is too minimal for complete context.

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?

Input schema coverage is 100%, so the schema fully describes both parameters. The description adds no extra meaning or usage context beyond what the schema provides. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (list), the resource (open incidents), and the scope (your New Relic account). It is specific and distinguishes from sibling tools like acknowledge_incident or search_entities, as it focuses on listing open incidents.

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, such as when to use acknowledge_incident for acknowledging incidents or search_entities for broader search. No contextual exclusions or recommendations are given.

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