Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_application_hosts

Retrieve a list of hosts associated with a specified APM application, using REST v2.

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 async handler function that executes the 'list_application_hosts' tool logic. It creates a REST client, builds the path /applications/{id}/hosts, adds optional filter[hostname], filter[ids], and page query params, and returns the REST API response.
    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;
    }
  • The ListHostsArgs input type definition with fields: application_id (required), filter_hostname, filter_ids, page, auto_paginate, region.
    type ListHostsArgs = {
      application_id: number;
      filter_hostname?: string;
      filter_ids?: string; // comma-separated
      page?: number;
      auto_paginate?: boolean;
      region?: Region;
    };
  • The getListApplicationHostsTool() method defines the tool schema: name 'list_application_hosts', description, and inputSchema (object with application_id, filter_hostname, filter_ids, page, auto_paginate, region).
    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'],
        },
      };
    }
  • src/server.ts:87-87 (registration)
    Registration: the tool is added to the tools map via restMetrics.getListApplicationHostsTool() in registerTools().
    restMetrics.getListApplicationHostsTool(),
  • src/server.ts:199-202 (registration)
    Dispatcher: the executeTool() method routes 'list_application_hosts' to new RestMetricsTool().listApplicationHosts(args).
    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?

No annotations provided. Description does not disclose pagination, rate limits, or read-only nature; only states it's REST v2.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence is efficient but lacks necessary detail; not verbose but insufficient.

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?

With 6 parameters and no output schema, description fails to explain pagination, filtering, or return 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 coverage is 0%; description adds no meaning beyond parameter names like 'filter_hostname' or 'auto_paginate'.

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?

Clearly states 'List hosts for an APM application' with verb and resource, but doesn't differentiate from sibling tools like list_apm_applications or get_entity_details.

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 explicit guidance on when to use this tool versus alternatives; only implies usage context via description.

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