Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_application_hosts

Retrieve and filter hosts associated with a New Relic APM application to monitor infrastructure supporting your services.

Instructions

List hosts for an APM application (REST v2).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
application_idYes
filter_hostnameNo
filter_idsNo
pageNo
auto_paginateNo
regionNo

Implementation Reference

  • The handler function that executes the list_application_hosts tool by querying the New Relic REST API for application hosts.
    async listApplicationHosts(args: ListHostsArgs): Promise<unknown> {
      const client = this.restFor(args.region);
      const path = `/applications/${args.application_id}/hosts`;
      const query: Record<string, unknown> = {};
      if (args.filter_hostname) query['filter[hostname]'] = args.filter_hostname;
      if (args.filter_ids) query['filter[ids]'] = args.filter_ids;
      if (args.page) query.page = args.page;
      const res = await client.get<unknown>(path, query);
      return res;
    }
  • Tool definition including name, description, and input schema for list_application_hosts.
    getListApplicationHostsTool(): Tool {
      return {
        name: 'list_application_hosts',
        description: 'List hosts for an APM application (REST v2).',
        inputSchema: {
          type: 'object',
          properties: {
            application_id: { type: 'number' },
            filter_hostname: { type: 'string' },
            filter_ids: { type: 'string' },
            page: { type: 'number' },
            auto_paginate: { type: 'boolean' },
            region: { type: 'string', enum: ['US', 'EU'] },
          },
          required: ['application_id'],
        },
      };
    }
  • TypeScript type definition for the input parameters of the listApplicationHosts handler.
    type ListHostsArgs = {
      application_id: number;
      filter_hostname?: string;
      filter_ids?: string; // comma-separated
      page?: number;
      auto_paginate?: boolean;
      region?: Region;
    };
  • src/server.ts:87-87 (registration)
    Adds the list_application_hosts tool to the server's list of available tools.
    restMetrics.getListApplicationHostsTool(),
  • src/server.ts:199-202 (registration)
    Switch case in executeTool that dispatches calls to the listApplicationHosts handler.
    case 'list_application_hosts':
      return await new RestMetricsTool().listApplicationHosts(
        args as Parameters<RestMetricsTool['listApplicationHosts']>[0]
      );
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it's a list operation. It doesn't disclose behavioral traits such as pagination behavior (implied by 'page' and 'auto_paginate' parameters), rate limits, authentication needs, or what the output looks like (no output schema). This leaves significant gaps for agent understanding.

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 front-loads the core purpose. It wastes no words and is appropriately sized for the tool's complexity, though it could benefit from additional context.

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 has 6 parameters (1 required), 0% schema description coverage, no annotations, and no output schema, the description is incomplete. It doesn't address key aspects like parameter usage, behavioral context, or output expectations, making it inadequate for effective agent invocation.

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 what 'application_id' refers to, how 'filter_hostname' or 'filter_ids' work, the purpose of 'page' and 'auto_paginate', or the significance of the 'region' enum. This fails to provide meaning beyond the bare schema.

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 ('hosts for an APM application'), specifying the API version ('REST v2'). It distinguishes from siblings like 'list_apm_applications' by focusing on hosts, but doesn't explicitly differentiate from 'get_entity_details' or 'list_metric_names_for_host' which might overlap in scope.

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 'get_entity_details' or 'list_metric_names_for_host'. The description mentions the API version, but doesn't explain why to choose this over other methods or tools for listing hosts.

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