Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_apm_applications_rest

Retrieve APM application data from New Relic using REST v2 API with filtering options for name, host, IDs, language, and region.

Instructions

List APM applications via REST v2.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filter_nameNo
filter_hostNo
filter_idsNo
filter_languageNo
pageNo
auto_paginateNo
regionNo

Implementation Reference

  • The handler function `listApplications` that executes the tool logic: constructs REST query with filters, performs GET requests to /applications, handles pagination and auto-pagination, returns list of applications.
      async listApplications(args: ListApplicationsArgs): Promise<unknown> {
        const client = this.restFor(args.region);
        const path = '/applications';
        const query: Record<string, unknown> = {};
        if (args.filter_name) query['filter[name]'] = args.filter_name;
        if (args.filter_host) query['filter[host]'] = args.filter_host;
        if (args.filter_language) query['filter[language]'] = args.filter_language;
        if (args.filter_ids && args.filter_ids.length > 0)
          query['filter[ids]'] = args.filter_ids.join(',');
        if (args.page) query.page = args.page;
    
        const results: unknown[] = [];
        let nextUrl: string | undefined;
        let page = args.page;
        do {
          const res = await client.get<unknown>(path, page ? { ...query, page } : query);
          results.push(res.data);
          const next = res.links?.next;
          if (args.auto_paginate && next) {
            const u = new URL(next);
            const p = u.searchParams.get('page');
            page = p ? Number(p) : undefined;
            nextUrl = next;
          } else {
            nextUrl = undefined;
          }
        } while (args.auto_paginate && nextUrl);
    
        return { items: args.auto_paginate ? results : results[0], page };
      }
    }
  • Defines the tool's schema: name, description, and inputSchema with properties for filtering, pagination, and region selection.
    getListApplicationsTool(): Tool {
      return {
        name: 'list_apm_applications_rest',
        description: 'List APM applications via REST v2.',
        inputSchema: {
          type: 'object',
          properties: {
            filter_name: { type: 'string' },
            filter_host: { type: 'string' },
            filter_ids: { type: 'array', items: { type: 'number' } },
            filter_language: { type: 'string' },
            page: { type: 'number' },
            auto_paginate: { type: 'boolean' },
            region: { type: 'string', enum: ['US', 'EU'] },
          },
        },
      };
    }
  • src/server.ts:84-84 (registration)
    Registers the tool definition (schema) into the tools array, which is later added to the server's tools Map.
    restApm.getListApplicationsTool(),
  • src/server.ts:187-190 (registration)
    Switch case in executeTool that dispatches calls to this tool name to the RestApmTool.listApplications handler.
    case 'list_apm_applications_rest':
      return await new RestApmTool().listApplications(
        args as Parameters<RestApmTool['listApplications']>[0]
      );
  • Helper method to create a NewRelicRestClient instance with API key and region.
    private restFor(region?: Region): NewRelicRestClient {
      const apiKey = process.env.NEW_RELIC_API_KEY as string;
      return new NewRelicRestClient({ apiKey, region: region ?? 'US' });
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action without disclosing behavioral traits such as pagination handling (implied by 'auto_paginate' parameter), rate limits, authentication needs, or response format. It misses critical details for a listing operation with multiple parameters.

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 with no wasted words, making it easy to parse. It's appropriately sized for a basic listing tool, though this conciseness comes at the cost of detail.

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 tool's complexity (7 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavior, parameter usage, and output, failing to provide enough context for effective agent use despite the concise structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain the purpose of filters like 'filter_name' or 'filter_host', the pagination parameters, or the 'region' enum, leaving all 7 parameters semantically undocumented.

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') and resource ('APM applications via REST v2'), making the purpose understandable. It distinguishes from the sibling 'list_apm_applications' by specifying the REST v2 interface, though it doesn't fully differentiate functionality beyond the API version.

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?

No guidance is provided on when to use this tool versus alternatives like 'list_apm_applications' or other listing tools. The description lacks context on prerequisites, use cases, or exclusions, leaving the agent without direction on tool selection.

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