Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

list_deployments_rest

Retrieve deployments for a New Relic APM application using REST v2. Specify the application ID to get a paginated list of deployment records.

Instructions

List deployments for an APM application (REST v2).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
application_idYes
pageNo
auto_paginateNo
regionNo

Implementation Reference

  • The handler function for 'list_deployments_rest'. Makes GET request to /applications/{id}/deployments, supports pagination (page param, auto_paginate with next-link following). Returns items array and current page.
    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,
      };
    }
  • Type definition for the input arguments of the list_deployments_rest handler.
    type ListDeploymentsArgs = {
      application_id: number;
      page?: number;
      auto_paginate?: boolean;
      region?: Region;
    };
  • Tool definition (name, description, inputSchema) for the 'list_deployments_rest' tool. Registers the schema used by the MCP protocol.
    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:179-182 (registration)
    Dispatch/registration in the executeTool switch-case that routes 'list_deployments_rest' to the RestDeploymentsTool().list() handler.
    case 'list_deployments_rest':
      return await new RestDeploymentsTool().list(
        args as Parameters<RestDeploymentsTool['list']>[0]
      );
  • src/server.ts:82-82 (registration)
    Registration of the tool definition into the server's tool list via restDeployments.getListTool() in registerTools().
    restDeployments.getListTool(),
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It only states 'List deployments' implying read-only, but fails to mention pagination behavior, error handling, or any side effects. Key details like pagination parameters are omitted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no structure. While concise, it is under-specified and lacks bullet points, examples, or organization. It 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.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 4 parameters, no output schema, and no annotations, the description is severely incomplete. It does not explain output format, pagination, region selection, or error behavior. The agent has insufficient context to use the tool effectively.

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%; the description adds no meaning to any parameter. It does not explain application_id, page, auto_paginate, or region. The agent has no semantic guidance beyond the schema's type/enum constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'list' and resource 'deployments', specifying scope 'for an APM application'. It distinguishes from sibling tools like create_deployment, delete_deployment, and list_apm_applications.

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 search_entities or run_nrql_query. No mention of prerequisites or context for use.

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