Skip to main content
Glama
cloudbring

New Relic MCP Server

by cloudbring

acknowledge_incident

Acknowledge open incidents in New Relic to signal active response and prevent duplicate alerts.

Instructions

Acknowledge an open incident

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
incident_idYesThe ID of the incident to acknowledge

Implementation Reference

  • Core handler function that performs the NerdGraph mutation to acknowledge the incident, handles optional comment, and processes the response including errors.
    async acknowledgeIncident(input: {
      incident_id: string;
      comment?: string;
    }): Promise<Record<string, unknown> | null> {
      const mutation = `
        mutation {
          aiIssuesAcknowledge(
            issueIds: ["${input.incident_id}"]
            ${input.comment ? `, comment: "${input.comment}"` : ''}
          ) {
            issues {
              issueId
              state
              acknowledgedAt
              acknowledgedBy
              ${input.comment ? 'comment' : ''}
            }
            errors {
              type
              description
            }
          }
        }
      `;
    
      const response = await this.client.executeNerdGraphQuery<{
        aiIssuesAcknowledge?: {
          issues?: Record<string, unknown>[];
          errors?: Array<{ description?: string }>;
        };
      }>(mutation);
      const result = response.data?.aiIssuesAcknowledge;
    
      if (result?.errors && result.errors.length > 0) {
        throw new Error(result.errors[0].description);
      }
    
      return result?.issues?.[0] || null;
    }
  • Defines the tool metadata, name, description, and input schema (requiring 'incident_id' string).
    getAcknowledgeTool(): Tool {
      return {
        name: 'acknowledge_incident',
        description: 'Acknowledge an open incident',
        inputSchema: {
          type: 'object',
          properties: {
            incident_id: {
              type: 'string',
              description: 'The ID of the incident to acknowledge',
            },
          },
          required: ['incident_id'],
        },
      };
    }
  • src/server.ts:74-76 (registration)
    Registers the 'acknowledge_incident' tool by including its definition from AlertTool.getAcknowledgeTool() in the server's tools list.
    alertTool.getPoliciesTool(),
    alertTool.getIncidentsTool(),
    alertTool.getAcknowledgeTool(),
  • Server-side dispatch handler that validates inputs and delegates to AlertTool.acknowledgeIncident.
    case 'acknowledge_incident': {
      const { incident_id, comment } = args as Record<string, unknown>;
      if (typeof incident_id !== 'string' || incident_id.trim() === '') {
        throw new Error('acknowledge_incident: "incident_id" (non-empty string) is required');
      }
      if (comment !== undefined && typeof comment !== 'string') {
        throw new Error('acknowledge_incident: "comment" must be a string when provided');
      }
      return await new AlertTool(this.client).acknowledgeIncident({
        incident_id,
        comment: comment as string | undefined,
      });
    }

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