pe_list_alerts
List active or resolved alerts from a Prism Element cluster, including severity, timestamps, and affected entities.
Instructions
List alerts on a Prism Element cluster. Returns alert titles, severity, timestamps, and affected entities.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pe_host | Yes | Prism Element CVM IP address or hostname | |
| resolved | No | Include resolved alerts (default: false, only active) | |
| count | No | Maximum number of alerts to return (default: 50) |
Implementation Reference
- Schema registration for 'pe_list_alerts' tool: defines the tool name, description, and input schema (requires pe_host, optional resolved boolean defaulting to False, optional count integer defaulting to 50).
{ "name": "pe_list_alerts", "description": ( "List alerts on a Prism Element cluster. " "Returns alert titles, severity, timestamps, and affected entities." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, "resolved": { "type": "boolean", "description": "Include resolved alerts (default: false, only active)", "default": False, }, "count": { "type": "integer", "description": "Maximum number of alerts to return (default: 50)", "default": 50, }, }, "required": ["pe_host"], }, }, - Handler function for 'pe_list_alerts' tool: calls client.pe_get(pe_host, 'alerts', params=params) with optional resolved=false filter, then returns alert titles, severity, timestamps, and affected entities.
async def handle_pe_list_alerts( client: NutanixClient, arguments: dict[str, Any] ) -> dict[str, Any]: """List alerts from Prism Element v2 API.""" pe_host = arguments["pe_host"] resolved = arguments.get("resolved", False) count = arguments.get("count", 50) params: dict[str, str] = {"count": str(count)} if not resolved: params["resolved"] = "false" result = await client.pe_get(pe_host, "alerts", params=params) entities = result.get("entities", []) return { "count": len(entities), "alerts": [ { "id": a.get("id"), "alertTitle": a.get("alert_title"), "severity": a.get("severity"), "message": a.get("message"), "resolved": a.get("resolved"), "createdTimeStamp": a.get("created_time_stamp_in_usecs"), "affectedEntities": a.get("affected_entities", []), } for a in entities ], } - src/nutanix_mcp/tools/prism_element.py:420-430 (registration)Handler dispatch dict PE_HANDLERS mapping the string 'pe_list_alerts' to the handle_pe_list_alerts function.
PE_HANDLERS: dict[str, Any] = { "pe_get_cluster_info": handle_pe_get_cluster_info, "pe_list_vms": handle_pe_list_vms, "pe_list_hosts": handle_pe_list_hosts, "pe_list_containers": handle_pe_list_containers, "pe_list_storage_pools": handle_pe_list_storage_pools, "pe_list_disks": handle_pe_list_disks, "pe_list_alerts": handle_pe_list_alerts, "pe_list_protection_domains": handle_pe_list_protection_domains, "pe_list_snapshots": handle_pe_list_snapshots, }