Skip to main content
Glama
jkmills

Nutanix MCP Server

by jkmills

pe_list_vms

List virtual machines on a Prism Element cluster, retrieving names, UUIDs, power states, and resource allocation for specified hosts.

Instructions

List VMs on a specific Prism Element cluster. Returns VM names, UUIDs, power states, and resource allocation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pe_hostYesPrism Element CVM IP address or hostname
countNoMaximum number of VMs to return

Implementation Reference

  • The main handler function for pe_list_vms. Calls client.pe_list(pe_host, 'vms', count=count) to fetch VMs from Prism Element v2 API, then extracts name, uuid, powerState, numVcpus, memoryMb, hostUuid, and ipAddresses for each VM.
    async def handle_pe_list_vms(
        client: NutanixClient, arguments: dict[str, Any]
    ) -> dict[str, Any]:
        """List VMs from Prism Element v2 API."""
        pe_host = arguments["pe_host"]
        count = arguments.get("count")
    
        result = await client.pe_list(pe_host, "vms", count=count)
        entities = result.get("entities", [])
    
        return {
            "count": len(entities),
            "vms": [
                {
                    "name": vm.get("name"),
                    "uuid": vm.get("uuid"),
                    "powerState": vm.get("power_state"),
                    "numVcpus": vm.get("num_vcpus"),
                    "memoryMb": vm.get("memory_mb"),
                    "hostUuid": vm.get("host_uuid"),
                    "ipAddresses": vm.get("ip_addresses", []),
                }
                for vm in entities
            ],
        }
  • The input schema (JSON Schema) for pe_list_vms. Defines required 'pe_host' (string) and optional 'count' (integer) parameters.
    {
        "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"],
        },
  • The handler dispatch dictionary (PE_HANDLERS) that maps 'pe_list_vms' to the handle_pe_list_vms function. This is merged into ALL_HANDLERS in server.py.
    # ─── Handler Dispatch ─────────────────────────────────────────────────────────
    
    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,
    }
  • The pe_list helper method in NutanixClient that handles the actual API call to Prism Element's v2 API. Called by handle_pe_list_vms with resource='vms'.
    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)
  • The MCP server registration via @server.list_tools() which returns the tool definitions (including pe_list_vms) to the MCP protocol.
    @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
        ]
Behavior4/5

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

No annotations provided, so description carries full burden. It explicitly states return values (names, UUIDs, power states, resource allocation) and implies read-only operation. Could add authentication details but sufficient for typical list tool.

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 concise sentences, each providing essential information: purpose and return fields. No unnecessary words.

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 simple nature of the tool with 2 parameters and no output schema, the description covers purpose, scope, and return fields. Could mention pagination or error handling but overall adequate.

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 descriptions for pe_host and count. Description does not add additional meaning beyond what schema provides. Baseline 3 is appropriate.

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?

Clearly states verb 'List', resource 'VMs', and scope 'on a specific Prism Element cluster', distinguishing from general list_vms sibling. Also specifies returned fields.

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

Usage Guidelines4/5

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

Description implies usage for specific Prism Element clusters, which differentiates from related tools. No explicit when-not or alternatives, but context is clear.

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