Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

run_nerdgraph_query

Execute custom GraphQL queries to interact with New Relic's NerdGraph API for data retrieval and management tasks.

Instructions

Execute a custom NerdGraph GraphQL query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe GraphQL query to execute
variablesNoOptional GraphQL variables to supply to the query

Implementation Reference

  • The primary handler for the 'run_nerdgraph_query' tool. Validates the GraphQL query and variables input using Zod, then delegates execution to the NewRelicClient.
    async execute(input: unknown): Promise<unknown> {
      // Validate input with Zod for consistency
      const schema = z.object({
        query: z.string().min(1, 'Invalid or empty GraphQL query provided'),
        variables: z.record(z.any()).optional(),
      });
    
      const { query, variables } = schema.parse(input);
    
      return await this.client.executeNerdGraphQuery(query, variables);
    }
  • Defines the tool's metadata, including name, description, and input schema specifying a required 'query' string and optional 'variables' object.
    getQueryTool(): Tool {
      return {
        name: 'run_nerdgraph_query',
        description: 'Execute a custom NerdGraph GraphQL query',
        inputSchema: {
          type: 'object',
          properties: {
            query: {
              type: 'string',
              description: 'The GraphQL query to execute',
            },
            variables: {
              type: 'object',
              description: 'Optional GraphQL variables to supply to the query',
            },
          },
          required: ['query'],
        },
      };
  • src/server.ts:79-80 (registration)
    Registers the 'run_nerdgraph_query' tool by including NerdGraphTool.getQueryTool() in the server's list of available tools.
    nerdGraphTool.getQueryTool(),
    // REST v2 tools
  • Server-side dispatch handler that instantiates NerdGraphTool and calls its execute method for 'run_nerdgraph_query' tool invocations.
    case 'run_nerdgraph_query':
      return await new NerdGraphTool(this.client).execute(args);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool executes a query but doesn't mention potential impacts like mutation risks, authentication requirements, rate limits, or response formats. For a tool that could perform writes via GraphQL mutations, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's function without any wasted words. It is appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

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

Given the complexity of executing custom GraphQL queries (which can include mutations), no annotations, and no output schema, the description is incomplete. It doesn't address behavioral risks, return values, or usage context, leaving significant gaps for an AI agent to understand how to use this tool safely and effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents both parameters ('query' and 'variables') with clear descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, but the baseline is 3 since the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Execute') and the resource ('custom NerdGraph GraphQL query'), making the purpose understandable. However, it doesn't differentiate from the sibling tool 'run_nrql_query', which appears to be a similar query execution tool for a different query language, so it misses full sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives like 'run_nrql_query' or other query/list tools in the sibling set. It lacks context about prerequisites, such as needing GraphQL knowledge or specific permissions, and doesn't mention any exclusions or recommended scenarios.

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