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
| Name | Required | Description | Default |
|---|---|---|---|
| incident_id | Yes | The ID of the incident to acknowledge |
Implementation Reference
- src/tools/alert.ts:166-204 (handler)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; }
- src/tools/alert.ts:48-63 (schema)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(),
- src/server.ts:215-227 (handler)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, }); }