pe_list_disks
List physical disks on a Nutanix Prism Element cluster, retrieving disk type, status, capacity, and location.
Instructions
List physical disks on a Prism Element cluster. Returns disk type (SSD/HDD), status, capacity, and location.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pe_host | Yes | Prism Element CVM IP address or hostname |
Implementation Reference
- The handler function that executes the pe_list_disks tool. Calls client.pe_list(pe_host, 'disks') and returns disk info including id, uuid, serialNumber, storageTierName, diskStatus, hostName, capacityBytes, and onlineStatus.
async def handle_pe_list_disks( client: NutanixClient, arguments: dict[str, Any] ) -> dict[str, Any]: """List physical disks from Prism Element v2 API.""" pe_host = arguments["pe_host"] result = await client.pe_list(pe_host, "disks") entities = result.get("entities", []) return { "count": len(entities), "disks": [ { "id": d.get("id"), "uuid": d.get("disk_uuid"), "serialNumber": d.get("disk_hardware_config", {}).get("serial_number"), "storageTierName": d.get("storage_tier_name"), "diskStatus": d.get("disk_status"), "hostName": d.get("host_name"), "capacityBytes": d.get("disk_size"), "onlineStatus": d.get("online"), } for d in entities ], } - The input schema definition for pe_list_disks. Declares the tool name, description, and required parameter 'pe_host' (string) as the Prism Element CVM IP/hostname.
{ "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"], }, }, - src/nutanix_mcp/tools/prism_element.py:420-430 (registration)Registration of pe_list_disks in the PE_HANDLERS dispatch dictionary, mapping the string 'pe_list_disks' to the handle_pe_list_disks 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/server.py:52-62 (registration)MCP server registration: the tool is listed via list_tools() from get_all_tools() and dispatched via call_tool() using the ALL_HANDLERS dict 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 ] - src/nutanix_mcp/client.py:436-457 (helper)Helper method pe_list() in NutanixClient that sends a GET request to the Prism Element v2 API for listing resources (e.g., 'disks'). This is what the handler calls.
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)