Skip to main content
Glama
jkmills

Nutanix MCP Server

by jkmills

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

TableJSON Schema
NameRequiredDescriptionDefault
pe_hostYesPrism 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"],
        },
  • 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,
    }
  • 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
  • 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
        ]
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries burden. It states the tool lists hosts and returns specific fields, implying a read-only operation. However, it does not disclose any behavioral traits like permissions required, rate limits, or potential complexity of the returned data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose, no wasted words. Efficiently conveys the tool's action and output scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, list operation), the description adequately covers purpose and output fields. Could mention potential limits like pagination or data size, but overall complete for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with one parameter 'pe_host' described as 'Prism Element CVM IP address or hostname'. Description does not add additional semantic meaning beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb 'List' and resource 'hypervisor hosts on a Prism Element cluster'. It specifies return fields (host names, IPs, hardware specs, CVM info), distinguishing it from sibling tool 'list_hosts' which likely targets Prism Central.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs. alternatives like 'list_hosts'. Context implies it is for Prism Element only, but does not state when not to use it or mention any prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jkmills/nutanix-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server