Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_deployments_rest

Retrieve deployment details for an APM application using REST v2. Input includes application ID, page number, auto-paginate option, and region.

Instructions

List deployments for an APM application (REST v2).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
application_idYes
auto_paginateNo
pageNo
regionNo

Implementation Reference

  • Executes the tool: fetches deployments for a given APM application ID using New Relic REST API v2, supports manual page and auto-pagination.
    async list(args: ListDeploymentsArgs): Promise<unknown> { const client = this.restFor(args.region); const path = `/applications/${args.application_id}/deployments`; const results: unknown[] = []; let page = args.page; let nextUrl: string | undefined; do { const res = await client.get<unknown>(path, page ? { page } : undefined); results.push(res.data); const next = res.links?.next; if (args.auto_paginate && next) { // Extract page from next URL if present 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: page, }; }
  • Defines the tool metadata, name, description, and input schema for list_deployments_rest.
    getListTool(): Tool { return { name: 'list_deployments_rest', description: 'List deployments for an APM application (REST v2).', inputSchema: { type: 'object', properties: { application_id: { type: 'number' }, page: { type: 'number' }, auto_paginate: { type: 'boolean' }, region: { type: 'string', enum: ['US', 'EU'] }, }, required: ['application_id'], }, }; }
  • src/server.ts:81-83 (registration)
    Registers the tool schema by including getListTool() in the list of tools advertised via MCP list_tools.
    restDeployments.getCreateTool(), restDeployments.getListTool(), restDeployments.getDeleteTool(),
  • src/server.ts:179-182 (registration)
    Dispatches tool execution in the MCP call_tool handler by instantiating RestDeploymentsTool and calling its list() method.
    case 'list_deployments_rest': return await new RestDeploymentsTool().list( args as Parameters<RestDeploymentsTool['list']>[0] );
  • TypeScript type definition for the input arguments used in schema and handler.
    application_id: number; page?: number; auto_paginate?: boolean; region?: Region; };

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