Skip to main content
Glama
jkmills

Nutanix MCP Server

by jkmills

list_hosts

List hypervisor hosts across clusters with names, IPs, capacity, and health. Filter by cluster or OData expression to narrow results.

Instructions

List hypervisor hosts across clusters. Returns host names, IPs, resource capacity, and health. Optionally filter by cluster.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cluster_uuidNoFilter hosts to a specific cluster UUID
filterNoOData filter expression
limitNoMaximum number of hosts to return. Omit to retrieve all (auto-paginates).

Implementation Reference

  • Schema/definition of the list_hosts tool, including name, description, and inputSchema with optional cluster_uuid, filter, and limit parameters.
    {
        "name": "list_hosts",
        "description": (
            "List hypervisor hosts across clusters. Returns host names, IPs, "
            "resource capacity, and health. Optionally filter by cluster."
        ),
        "inputSchema": {
            "type": "object",
            "properties": {
                "cluster_uuid": {
                    "type": "string",
                    "description": "Filter hosts to a specific cluster UUID",
                },
                "filter": {
                    "type": "string",
                    "description": "OData filter expression",
                },
                "limit": {
                    "type": "integer",
                    "description": "Maximum number of hosts to return. Omit to retrieve all (auto-paginates).",
                },
            },
        },
    },
  • Handler function handle_list_hosts: executes the list_hosts tool logic, calls v4 clustermgmt API to list hosts (optionally filtered by cluster_uuid), extracts hypervisor host info (name, extId, IP, CPU, memory, cluster), and returns paginated results.
    async def handle_list_hosts(
        client: NutanixClient, arguments: dict[str, Any]
    ) -> dict[str, Any]:
        """List hosts using v4 clustermgmt API."""
        cluster_uuid = arguments.get("cluster_uuid")
        filter_expr = arguments.get("filter")
        limit = arguments.get("limit")
    
        # If cluster_uuid provided, filter to that cluster's hosts
        if cluster_uuid:
            path = f"config/clusters/{cluster_uuid}/hosts"
        else:
            path = "config/hosts"
    
        result = await client.v4_list_all(
            namespace="clustermgmt",
            path=path,
            filter=filter_expr,
            max_results=limit,
        )
    
        hosts = result.get("data", [])
        metadata = result.get("metadata", {})
    
        def _extract_host(h: dict) -> dict:
            hypervisor = h.get("hypervisor") or {}
            ext_addr = hypervisor.get("externalAddress") or {}
            ipv4 = ext_addr.get("ipv4") or {}
            cluster_ref = h.get("cluster") or {}
            return {
                "name": h.get("hostName"),
                "extId": h.get("extId"),
                "hypervisorType": hypervisor.get("type"),
                "ipAddress": ipv4.get("value"),
                "cpuModel": h.get("cpuModel"),
                "numCpuSockets": h.get("numberOfCpuSockets"),
                "numCpuCores": h.get("numberOfCpuCores"),
                "memorySizeBytes": h.get("memorySizeBytes"),
                "cluster": cluster_ref.get("uuid") or cluster_ref.get("extId"),
                "clusterName": cluster_ref.get("name"),
            }
    
        return {
            "count": len(hosts),
            "truncated": metadata.get("truncated", False),
            "hosts": [_extract_host(h) for h in hosts],
        }
  • CLUSTER_HANDLERS dispatch dictionary mapping 'list_hosts' to handle_list_hosts function.
    CLUSTER_HANDLERS: dict[str, Any] = {
        "list_clusters": handle_list_clusters,
        "get_cluster": handle_get_cluster,
        "list_hosts": handle_list_hosts,
        "get_host": handle_get_host,
        "list_storage_containers": handle_list_storage_containers,
    }
  • Config reference: allowed_pe_hosts setting mentions that PE tools accept hosts discovered via list_hosts.
    allowed_pe_hosts: list[str] = Field(
        default_factory=list,
        description=(
            "Allowlist of Prism Element hosts (IPs or hostnames). "
            "If empty, PE tools will only accept hosts discovered via list_hosts. "
Behavior3/5

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

No annotations are provided, so the description carries the burden. It implies a read operation by stating 'List...Returns', but does not explicitly disclose safety, idempotency, authentication needs, or side effects. The schema's limit parameter hints at auto-pagination, but that is not in the description.

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?

The description is two sentences with zero waste. It front-loads the action and resource, then offers optional usage, making it efficient and easy to scan.

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 complexity of a list tool with no output schema, the description adequately covers the return fields (names, IPs, capacity, health) and optional filtering. It is almost complete, but could mention pagination behavior or default ordering.

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%, so parameters are documented in the schema. The description adds only 'Optionally filter by cluster', which reinforces cluster_uuid but does not add format or behavior details beyond the schema.

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?

The description clearly states the verb (list), resource (hypervisor hosts), scope (across clusters), and the specific return fields (names, IPs, capacity, health). It distinguishes from sibling get_host which retrieves a single host.

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?

The description mentions optional filtering by cluster, providing some context. However, it does not specify when to use this tool over alternatives like pe_list_hosts or list_clusters, and lacks when-not guidance.

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