Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_application_hosts

Discover and filter APM application hosts using REST v2 queries. Specify hostnames, IDs, and pagination for targeted results with New Relic MCP Server integration.

Instructions

List hosts for an APM application (REST v2).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
application_idYes
auto_paginateNo
filter_hostnameNo
filter_idsNo
pageNo
regionNo

Implementation Reference

  • The core handler function that implements the logic for 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; }
  • TypeScript type definition for the input parameters of the list_application_hosts tool.
    type ListHostsArgs = { application_id: number; filter_hostname?: string; filter_ids?: string; // comma-separated page?: number; auto_paginate?: boolean; region?: Region; };
  • Tool definition method that provides the name, description, and input schema for registering the 'list_application_hosts' tool.
    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 of the tool in the server's tools list by calling getListApplicationHostsTool().
    restMetrics.getListApplicationHostsTool(),
  • src/server.ts:199-202 (registration)
    Dispatch handler in the server's executeTool switch statement that invokes the tool's handler function.
    case 'list_application_hosts': return await new RestMetricsTool().listApplicationHosts( args as Parameters<RestMetricsTool['listApplicationHosts']>[0] );

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