Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_apm_applications

Retrieve all APM applications from your New Relic account to monitor application performance and health.

Instructions

List all APM applications in your New Relic account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_account_idNoOptional New Relic account ID

Implementation Reference

  • The primary handler for the 'list_apm_applications' tool. Validates the input target_account_id and calls the NewRelicClient to fetch APM applications.
    async execute(input: { target_account_id?: string }): Promise<ApmApplication[]> { if (!input.target_account_id) { throw new Error('Account ID must be provided'); } const applications = await this.client.listApmApplications(input.target_account_id); return applications; }
  • Input schema definition for the tool, specifying the optional target_account_id parameter.
    inputSchema: { type: 'object', properties: { target_account_id: { type: 'string', description: 'Optional New Relic account ID', }, }, },
  • src/server.ts:71-71 (registration)
    Registration of the tool by adding its definition to the list of available tools in the MCP server.
    apmTool.getListApplicationsTool(),
  • MCP server dispatch handler for the tool call, instantiating ApmTool and invoking its execute method with resolved account ID.
    case 'list_apm_applications': return await new ApmTool(this.client).execute({ ...args, target_account_id: accountId, });
  • Core helper method that executes the NerdGraph entitySearch GraphQL query to retrieve APM applications for the specified account and parses the response.
    async listApmApplications(accountId?: string): Promise<ApmApplication[]> { const id = accountId || this.defaultAccountId; if (!id) { throw new Error('Account ID must be provided'); } const query = `{ actor { entitySearch(query: "domain = 'APM' AND type = 'APPLICATION' AND accountId = '${id}'") { results { entities { guid name ... on ApmApplicationEntityOutline { language reporting alertSeverity tags { key values } } } } } } }`; type EntitySearchResponse = { actor?: { entitySearch?: { results?: { entities?: Array<{ guid: string; name: string; language?: string; reporting?: boolean; alertSeverity?: string; tags?: Array<{ key?: string; values?: string[] }>; }>; }; }; }; }; const response = (await this.executeNerdGraphQuery<EntitySearchResponse>( query )) as GraphQLResponse<EntitySearchResponse>; const entities = (response.data?.actor?.entitySearch?.results?.entities || []) as Array<{ guid: string; name: string; language?: string; reporting?: boolean; alertSeverity?: string; tags?: Array<{ key?: string; values?: string[] }>; }>; return entities.map((entity) => ({ guid: entity.guid, name: entity.name, language: entity.language || 'unknown', reporting: entity.reporting || false, alertSeverity: entity.alertSeverity, tags: this.parseTags(entity.tags), })); }

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