Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_deployments_rest

Retrieve deployment history for a New Relic APM application using REST v2 API to monitor application changes and track deployment timelines.

Instructions

List deployments for an APM application (REST v2).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
application_idYes
pageNo
auto_paginateNo
regionNo

Implementation Reference

  • Core handler function that executes the list_deployments_rest tool: fetches deployments via REST API with optional pagination support.
    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 schema including name, description, and input validation schema.
    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 list_deployments_rest tool by calling getListTool() on RestDeploymentsTool instance and adding to the server's tools list.
    restDeployments.getCreateTool(), restDeployments.getListTool(), restDeployments.getDeleteTool(),
  • Server-side dispatcher that invokes the tool handler upon tool call request.
    case 'list_deployments_rest': return await new RestDeploymentsTool().list( args as Parameters<RestDeploymentsTool['list']>[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