Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_alert_policies

Retrieve all alert policies from your New Relic account to monitor and manage notification rules for application performance.

Instructions

List all alert policies in your New Relic account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_account_idNoOptional New Relic account ID

Implementation Reference

  • The handler function that performs a NerdGraph query to retrieve alert policies for the specified account.
    async listAlertPolicies(input: {
      target_account_id?: string;
    }): Promise<Array<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');
      }
    
      const query = `{
        actor {
          account(id: ${accountId}) {
            alerts {
              policiesSearch {
                policies {
                  id
                  name
                  incidentPreference
                  conditions {
                    id
                    name
                    enabled
                  }
                }
              }
            }
          }
        }
      }`;
    
      const response = await this.client.executeNerdGraphQuery<{
        actor?: {
          account?: { alerts?: { policiesSearch?: { policies?: Array<Record<string, unknown>> } } };
        };
      }>(query);
      return response.data?.actor?.account?.alerts?.policiesSearch?.policies || [];
    }
  • Input schema definition for the list_alert_policies tool.
    inputSchema: {
      type: 'object',
      properties: {
        target_account_id: {
          type: 'string',
          description: 'Optional New Relic account ID',
        },
      },
    },
  • src/server.ts:205-209 (registration)
    Registration and dispatch of the list_alert_policies tool call in the server's executeTool switch statement.
    case 'list_alert_policies':
      return await new AlertTool(this.client).listAlertPolicies({
        ...args,
        target_account_id: accountId,
      });
  • src/server.ts:74-74 (registration)
    Registers the tool definition from AlertTool.getPoliciesTool() into the server's tools map.
    alertTool.getPoliciesTool(),
  • src/server.ts:301-301 (registration)
    Includes list_alert_policies in the list of tools requiring an account ID.
    'list_alert_policies',
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't cover pagination, rate limits, authentication requirements, or return format. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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 states exactly what the tool does with zero wasted words. It's appropriately sized for a simple list operation and front-loads the core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with one optional parameter and no output schema, the description covers the basic purpose adequately. However, with no annotations and no output schema, it should ideally provide more context about what the list contains, how results are structured, or any limitations.

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 schema already documents the single parameter. The description doesn't add any parameter-specific information beyond what's in the schema, but with complete schema coverage, the baseline score of 3 is appropriate.

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 resource ('alert policies') with scope ('in your New Relic account'), making the purpose immediately understandable. However, it doesn't differentiate from potential sibling tools like 'list_open_incidents' or 'list_synthetics_monitors' beyond the resource type, which prevents a perfect 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 prerequisites, timing considerations, or how it differs from other list tools in the sibling set, leaving the agent to infer usage context.

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