Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_apm_applications

Retrieve all APM applications from your New Relic account to monitor application performance and health.

Instructions

List all APM applications in your New Relic account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_account_idNoOptional New Relic account ID

Implementation Reference

  • The primary handler for the 'list_apm_applications' tool. Validates the input target_account_id and calls the NewRelicClient to fetch APM applications.
    async execute(input: { target_account_id?: string }): Promise<ApmApplication[]> {
      if (!input.target_account_id) {
        throw new Error('Account ID must be provided');
      }
    
      const applications = await this.client.listApmApplications(input.target_account_id);
      return applications;
    }
  • Input schema definition for the tool, specifying the optional target_account_id parameter.
    inputSchema: {
      type: 'object',
      properties: {
        target_account_id: {
          type: 'string',
          description: 'Optional New Relic account ID',
        },
      },
    },
  • src/server.ts:71-71 (registration)
    Registration of the tool by adding its definition to the list of available tools in the MCP server.
    apmTool.getListApplicationsTool(),
  • MCP server dispatch handler for the tool call, instantiating ApmTool and invoking its execute method with resolved account ID.
    case 'list_apm_applications':
      return await new ApmTool(this.client).execute({
        ...args,
        target_account_id: accountId,
      });
  • Core helper method that executes the NerdGraph entitySearch GraphQL query to retrieve APM applications for the specified account and parses the response.
    async listApmApplications(accountId?: string): Promise<ApmApplication[]> {
      const id = accountId || this.defaultAccountId;
      if (!id) {
        throw new Error('Account ID must be provided');
      }
    
      const query = `{
        actor {
          entitySearch(query: "domain = 'APM' AND type = 'APPLICATION' AND accountId = '${id}'") {
            results {
              entities {
                guid
                name
                ... on ApmApplicationEntityOutline {
                  language
                  reporting
                  alertSeverity
                  tags {
                    key
                    values
                  }
                }
              }
            }
          }
        }
      }`;
    
      type EntitySearchResponse = {
        actor?: {
          entitySearch?: {
            results?: {
              entities?: Array<{
                guid: string;
                name: string;
                language?: string;
                reporting?: boolean;
                alertSeverity?: string;
                tags?: Array<{ key?: string; values?: string[] }>;
              }>;
            };
          };
        };
      };
      const response = (await this.executeNerdGraphQuery<EntitySearchResponse>(
        query
      )) as GraphQLResponse<EntitySearchResponse>;
      const entities = (response.data?.actor?.entitySearch?.results?.entities || []) as Array<{
        guid: string;
        name: string;
        language?: string;
        reporting?: boolean;
        alertSeverity?: string;
        tags?: Array<{ key?: string; values?: string[] }>;
      }>;
    
      return entities.map((entity) => ({
        guid: entity.guid,
        name: entity.name,
        language: entity.language || 'unknown',
        reporting: entity.reporting || false,
        alertSeverity: entity.alertSeverity,
        tags: this.parseTags(entity.tags),
      }));
    }
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 only states what the tool does ('List all APM applications') without addressing key aspects like whether it's a read-only operation, pagination behavior, rate limits, authentication needs, or what the output format looks like. This leaves significant gaps in understanding how the tool 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 directly states the tool's purpose without any unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 lack of annotations and output schema, the description is insufficient for a tool that likely returns a list of applications. It doesn't explain the return structure, error conditions, or behavioral traits like pagination. For a listing tool with no structured support, more context is needed to be complete.

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 input schema has 100% description coverage, with the single parameter 'target_account_id' documented as 'Optional New Relic account ID'. The description adds no additional parameter information beyond this, so it meets the baseline for high schema coverage without compensating value.

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 ('all APM applications in your New Relic account'), making the tool's purpose immediately understandable. However, it doesn't distinguish itself from the sibling tool 'list_apm_applications_rest', which appears to serve a similar function, preventing 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 like 'list_apm_applications_rest' or other listing tools such as 'list_alert_policies'. There's no mention of prerequisites, exclusions, or specific contexts where this tool is preferred, leaving the agent without usage direction.

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