Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_metric_names_for_host

Retrieve metric names and values for a specific application host using the New Relic REST v2 API.

Instructions

List metric names and values for a specific application host (REST v2).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
application_idYes
host_idYes
nameNo
pageNo
auto_paginateNo
regionNo

Implementation Reference

  • The handler function that executes the list_metric_names_for_host tool logic. It calls the New Relic REST v2 API at /applications/{app_id}/hosts/{host_id}/metrics, supports optional name filtering and auto-pagination.
    async listMetricNames(args: ListMetricNamesArgs): Promise<unknown> {
      const client = this.restFor(args.region);
      const path = `/applications/${args.application_id}/hosts/${args.host_id}/metrics`;
      const query: Record<string, unknown> = {};
      if (args.name) query.name = args.name;
      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 };
  • TypeScript type definition for the input arguments of listMetricNames.
    type ListMetricNamesArgs = {
      application_id: number;
      host_id: number;
      name?: string;
      page?: number;
      auto_paginate?: boolean;
      region?: Region;
    };
  • The tool definition/schema for list_metric_names_for_host, describing its name, description, input properties, and required fields.
    getListMetricNamesTool(): Tool {
      return {
        name: 'list_metric_names_for_host',
        description: 'List metric names and values for a specific application host (REST v2).',
        inputSchema: {
          type: 'object',
          properties: {
            application_id: { type: 'number' },
            host_id: { type: 'number' },
            name: { type: 'string' },
            page: { type: 'number' },
            auto_paginate: { type: 'boolean' },
            region: { type: 'string', enum: ['US', 'EU'] },
          },
          required: ['application_id', 'host_id'],
        },
      };
  • src/server.ts:85-85 (registration)
    Registration of the list_metric_names_for_host tool in the registerTools() method via restMetrics.getListMetricNamesTool().
    restMetrics.getListMetricNamesTool(),
  • src/server.ts:191-194 (registration)
    The dispatch case in executeTool() that routes to RestMetricsTool.listMetricNames when the tool name matches.
    case 'list_metric_names_for_host':
      return await new RestMetricsTool().listMetricNames(
        args as Parameters<RestMetricsTool['listMetricNames']>[0]
      );
Behavior2/5

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

No annotations provided, and the description lacks behavioral details like authentication, rate limits, or pagination behavior. Only states a simple list operation.

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 concise and front-loaded, but too terse given the tool has 6 parameters. Could be more informative without adding length.

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?

Description lacks essential context: no mention of optional pagination, filtering by name, region selection, or output format. Incomplete for a tool with 6 parameters and no output schema.

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

Parameters1/5

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

Schema description coverage is 0%, and the description adds no meaning to parameters. It does not explain the purpose of 'name', 'page', 'auto_paginate', or 'region' beyond their types.

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?

Description clearly states the action 'List' and resource 'metric names and values for a specific application host'. It distinguishes from siblings like 'list_application_hosts' and 'get_metric_data_for_host', but does not explicitly differentiate. Slight inconsistency: name says 'metric_names' but description adds 'and values'.

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 on when to use this tool versus alternatives such as 'get_metric_data_for_host'. Does not mention context for pagination or filtering.

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