metrx_acknowledge_alert
Mark alerts as read to clear them from the unread list while preserving them in history. Use after addressing the underlying issue to maintain organized alert tracking.
Instructions
Mark one or more alerts as read/acknowledged. This removes them from the unread alerts list but preserves them in history. Do NOT use for resolving the underlying issue — take action on the alert first.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alert_ids | Yes | Alert IDs to acknowledge |
Implementation Reference
- src/tools/alerts.ts:96-117 (handler)The acknowledge_alert handler function that executes the alert acknowledgment logic. It makes a PATCH request to /alerts with action 'acknowledge' and the provided alert_ids, returning a success message with the count of acknowledged alerts.
async ({ alert_ids }) => { const result = await client.patch<{ acknowledged: number }>('/alerts', { action: 'acknowledge', alert_ids, }); if (result.error) { return { content: [{ type: 'text', text: `Error acknowledging alerts: ${result.error}` }], isError: true, }; } return { content: [ { type: 'text', text: `✅ ${result.data?.acknowledged || alert_ids.length} alert(s) acknowledged.`, }, ], }; } - src/tools/alerts.ts:78-118 (registration)Registration of the acknowledge_alert tool with the MCP server. Includes tool metadata (title, description), annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint), and the handler function.
server.registerTool( 'acknowledge_alert', { title: 'Acknowledge Alert', description: 'Mark one or more alerts as read/acknowledged. ' + 'This removes them from the unread alerts list but preserves them in history. ' + 'Do NOT use for resolving the underlying issue — take action on the alert first.', inputSchema: { alert_ids: z.array(z.string().uuid()).min(1).max(50).describe('Alert IDs to acknowledge'), }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, }, async ({ alert_ids }) => { const result = await client.patch<{ acknowledged: number }>('/alerts', { action: 'acknowledge', alert_ids, }); if (result.error) { return { content: [{ type: 'text', text: `Error acknowledging alerts: ${result.error}` }], isError: true, }; } return { content: [ { type: 'text', text: `✅ ${result.data?.acknowledged || alert_ids.length} alert(s) acknowledged.`, }, ], }; } ); - src/tools/alerts.ts:86-88 (schema)Input schema for the acknowledge_alert tool. Validates that alert_ids is an array of 1-50 UUID strings.
inputSchema: { alert_ids: z.array(z.string().uuid()).min(1).max(50).describe('Alert IDs to acknowledge'), },