list_alerts
Retrieve system alerts from the CloudStack MCP Server to monitor and manage cloud infrastructure issues. Specify alert types for targeted insights into resource states and operations.
Instructions
List system alerts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Alert type |
Implementation Reference
- The main handler function that executes the list_alerts tool logic. It calls the CloudStack client to fetch alerts, processes them, and formats the response as MCP content.async handleListAlerts(args: any) { const result = await this.cloudStackClient.listAlerts(args); const alerts = result.listalertsresponse?.alert || []; const alertList = alerts.map((alert: any) => ({ id: alert.id, type: alert.type, description: alert.description, sent: alert.sent, name: alert.name })); return { content: [ { type: 'text', text: `Found ${alertList.length} alerts:\n\n${alertList .map((alert: any) => `• ${alert.name} (${alert.id})\n Type: ${alert.type}\n Description: ${alert.description}\n Sent: ${alert.sent}\n` ) .join('\n')}` } ] }; }
- The input schema and metadata definition for the list_alerts tool.name: 'list_alerts', description: 'List system alerts', inputSchema: { type: 'object', properties: { type: { type: 'string', description: 'Alert type', }, }, additionalProperties: false, }, },
- src/server.ts:168-169 (registration)Registration of the list_alerts tool in the MCP server switch statement, dispatching to the monitoring handler.case 'list_alerts': return await this.monitoringHandlers.handleListAlerts(args);
- src/cloudstack-client.ts:226-228 (helper)Helper method in CloudStackClient that makes the actual API request to listAlerts endpoint.async listAlerts(params: CloudStackParams = {}): Promise<CloudStackResponse> { return this.request('listAlerts', params); }