pe_get_cluster_info
Retrieve cluster information from a Prism Element node, including AOS version, cluster name, storage capacity, and health status.
Instructions
Get cluster info directly from a Prism Element node. Returns AOS version, cluster name, storage capacity, and health.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pe_host | Yes | Prism Element CVM IP address or hostname |
Implementation Reference
- src/nutanix_mcp/tools/prism_element.py:13-184 (registration)Tool definition/registration for pe_get_cluster_info in the PE_TOOLS list, which is exported and registered via the MCP server.
PE_TOOLS: list[dict] = [ { "name": "pe_get_cluster_info", "description": ( "Get cluster info directly from a Prism Element node. " "Returns AOS version, cluster name, storage capacity, and health." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, }, "required": ["pe_host"], }, }, { "name": "pe_list_vms", "description": ( "List VMs on a specific Prism Element cluster. " "Returns VM names, UUIDs, power states, and resource allocation." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, "count": { "type": "integer", "description": "Maximum number of VMs to return", }, }, "required": ["pe_host"], }, }, { "name": "pe_list_hosts", "description": ( "List hypervisor hosts on a Prism Element cluster. " "Returns host names, IPs, hardware specs, and CVM info." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, }, "required": ["pe_host"], }, }, { "name": "pe_list_containers", "description": ( "List storage containers on a Prism Element cluster. " "Returns names, capacity, usage, replication factor, and policies." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, }, "required": ["pe_host"], }, }, { "name": "pe_list_storage_pools", "description": ( "List storage pools on a Prism Element cluster. " "Returns pool names, capacity, and disk composition." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, }, "required": ["pe_host"], }, }, { "name": "pe_list_disks", "description": ( "List physical disks on a Prism Element cluster. " "Returns disk type (SSD/HDD), status, capacity, and location." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, }, "required": ["pe_host"], }, }, { "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"], }, }, { "name": "pe_list_protection_domains", "description": ( "List protection domains on a Prism Element cluster. " "Returns PD names, protected entities, schedules, and replication state." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, }, "required": ["pe_host"], }, }, { "name": "pe_list_snapshots", "description": ( "List snapshots for a protection domain on a Prism Element cluster." ), "inputSchema": { "type": "object", "properties": { "pe_host": { "type": "string", "description": "Prism Element CVM IP address or hostname", }, "protection_domain": { "type": "string", "description": "Name of the protection domain", }, }, "required": ["pe_host", "protection_domain"], }, }, ] - Handler function that executes the pe_get_cluster_info logic: calls client.pe_get(pe_host, 'cluster') and returns cluster name, uuid, version, node count, storage type, hypervisor types, and external IP.
async def handle_pe_get_cluster_info( client: NutanixClient, arguments: dict[str, Any] ) -> dict[str, Any]: """Get cluster info from Prism Element v2 API.""" pe_host = arguments["pe_host"] result = await client.pe_get(pe_host, "cluster") return { "name": result.get("name"), "clusterUuid": result.get("cluster_uuid"), "version": result.get("version"), "numNodes": result.get("num_nodes"), "storageType": result.get("storage_type"), "hypervisorTypes": result.get("hypervisor_types"), "clusterExternalIp": result.get("cluster_external_ipaddress"), } - src/nutanix_mcp/tools/prism_element.py:420-430 (registration)Handler dispatch mapping that maps the tool name 'pe_get_cluster_info' to its handler 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, } - src/nutanix_mcp/client.py:404-457 (helper)The NutanixClient.pe_get method used by the handler to make the GET request to the Prism Element v2 API at the 'cluster' endpoint.
async def pe_get( self, pe_host: str, path: str, params: Optional[dict[str, str]] = None, ) -> dict[str, Any]: """GET request against a Prism Element v2 API. Args: pe_host: Prism Element CVM IP or hostname path: Resource path (e.g., 'vms', 'hosts', 'cluster') """ client = await self._get_pe_client(pe_host) try: response = await client.get(f"/{path}", params=params) except httpx.ConnectError as e: raise NutanixAPIError( f"Connection failed to PE host {pe_host}", details=str(e), ) except httpx.TimeoutException as e: raise NutanixAPIError( f"Request to PE {pe_host} timed out after {self.settings.timeout}s", details=str(e), ) if response.status_code >= 400: self._handle_error(response) return response.json() async def pe_list( self, pe_host: str, resource: str, count: Optional[int] = None, filter_criteria: Optional[str] = None, ) -> dict[str, Any]: """List resources from a Prism Element node using v2 API. Args: pe_host: Prism Element CVM IP or hostname resource: Resource type (e.g., 'vms', 'hosts', 'disks', 'containers') count: Max results to return filter_criteria: Filter string for the query """ params: dict[str, str] = {} if count is not None: params["count"] = str(count) if filter_criteria: params["filter_criteria"] = filter_criteria return await self.pe_get(pe_host, resource, params=params) - src/nutanix_mcp/server.py:52-62 (registration)MCP server registration: list_tools() returns all tool definitions (including pe_get_cluster_info via PE_TOOLS), and call_tool() dispatches to the correct handler via ALL_HANDLERS (which includes PE_HANDLERS).
@server.list_tools() async def list_tools() -> list[Tool]: """Return the list of available tools.""" return [ Tool( name=tool["name"], description=tool["description"], inputSchema=tool["inputSchema"], ) for tool in all_tools ]