pe_list_hosts
Lists hypervisor hosts on a Prism Element cluster, returning names, IPs, hardware specifications, and CVM information.
Instructions
List hypervisor hosts on a Prism Element cluster. Returns host names, IPs, hardware specs, and CVM info.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pe_host | Yes | Prism Element CVM IP address or hostname |
Implementation Reference
- Handler function that executes the pe_list_hosts tool logic. Calls client.pe_list(pe_host, 'hosts') and returns host details (name, uuid, hypervisor address, CVM address, CPU model, sockets, cores, memory, hypervisor type).
async def handle_pe_list_hosts( client: NutanixClient, arguments: dict[str, Any] ) -> dict[str, Any]: """List hosts from Prism Element v2 API.""" pe_host = arguments["pe_host"] result = await client.pe_list(pe_host, "hosts") entities = result.get("entities", []) return { "count": len(entities), "hosts": [ { "name": h.get("name"), "uuid": h.get("uuid"), "hypervisorAddress": h.get("hypervisor_address"), "cvmAddress": h.get("controller_vm_backplane_ip"), "cpuModel": h.get("cpu_model"), "numCpuSockets": h.get("num_cpu_sockets"), "numCpuCores": h.get("num_cpu_cores"), "memoryCapacityGb": (h.get("memory_capacity_in_bytes", 0)) // (1024**3), "hypervisorType": h.get("hypervisor_type"), } for h in entities ], } - Input schema definition for pe_list_hosts tool. Requires 'pe_host' (string) as the only required parameter.
{ "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"], }, - src/nutanix_mcp/tools/prism_element.py:420-430 (registration)Handler dispatch mapping that registers handle_pe_list_hosts under the key 'pe_list_hosts' in the PE_HANDLERS dict.
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/tools/__init__.py:10-12 (registration)Aggregates PE_TOOLS (including pe_list_hosts schema definition) into the global tool list via get_all_tools().
def get_all_tools() -> list[dict]: """Return all registered tool definitions.""" return VM_TOOLS + CLUSTER_TOOLS + PE_TOOLS + REPORT_TOOLS + NETWORKING_TOOLS - src/nutanix_mcp/server.py:52-62 (registration)MCP server registration: list_tools() returns all tool definitions (including pe_list_hosts) and call_tool() dispatches to 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 ]