Skip to main content
Glama
jkmills

Nutanix MCP Server

by jkmills

create_vm

Create a new virtual machine by providing a name, cluster UUID, and optional vCPU, memory, and disk specifications.

Instructions

Create a new virtual machine. Requires name, cluster UUID, and basic specs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName for the new VM
cluster_uuidYesUUID of the cluster to create the VM on
num_vcpusNoNumber of vCPUs (default: 2)
memory_mbNoMemory in MB (default: 4096)
disk_size_gbNoBoot disk size in GB (default: 40)

Implementation Reference

  • The async handler function that creates a VM. Extracts arguments (name, cluster_uuid, num_vcpus, memory_mb, disk_size_gb), builds the request body, and calls v4_post to the Nutanix vmm API at 'ahv/config/vms'. Returns a taskExtId for tracking the async VM creation.
    async def handle_create_vm(
        client: NutanixClient, arguments: dict[str, Any]
    ) -> dict[str, Any]:
        """Create a VM using v4 vmm API."""
        name = arguments["name"]
        cluster_uuid = arguments["cluster_uuid"]
        num_vcpus = arguments.get("num_vcpus", 2)
        memory_mb = arguments.get("memory_mb", 4096)
        disk_size_gb = arguments.get("disk_size_gb", 40)
    
        body = {
            "name": name,
            "cluster": {"extId": cluster_uuid},
            "numSockets": 1,
            "numCoresPerSocket": num_vcpus,
            "memorySizeBytes": memory_mb * 1024 * 1024,
            "disks": [
                {
                    "diskSizeBytes": disk_size_gb * 1024 * 1024 * 1024,
                    "storageConfig": {
                        "storageContainerReference": None,
                    },
                }
            ],
        }
    
        result = await client.v4_post(
            namespace="vmm",
            path="ahv/config/vms",
            body=body,
        )
        return {
            "status": "vm_creation_initiated",
            "taskExtId": result.get("data", {}).get("extId"),
        }
  • The input schema definition for the 'create_vm' tool. Defines parameters: name (required), cluster_uuid (required), num_vcpus (default 2), memory_mb (default 4096), disk_size_gb (default 40).
    {
        "name": "create_vm",
        "description": (
            "Create a new virtual machine. Requires name, cluster UUID, and basic specs."
        ),
        "inputSchema": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Name for the new VM",
                },
                "cluster_uuid": {
                    "type": "string",
                    "description": "UUID of the cluster to create the VM on",
                },
                "num_vcpus": {
                    "type": "integer",
                    "description": "Number of vCPUs (default: 2)",
                    "default": 2,
                },
                "memory_mb": {
                    "type": "integer",
                    "description": "Memory in MB (default: 4096)",
                    "default": 4096,
                },
                "disk_size_gb": {
                    "type": "integer",
                    "description": "Boot disk size in GB (default: 40)",
                    "default": 40,
                },
            },
            "required": ["name", "cluster_uuid"],
        },
    },
  • The handler dispatch table mapping the string 'create_vm' to the handle_create_vm function in the VM_HANDLERS dictionary.
    VM_HANDLERS: dict[str, Any] = {
        "list_vms": handle_list_vms,
        "get_vm": handle_get_vm,
        "power_on_vm": handle_power_on_vm,
        "power_off_vm": handle_power_off_vm,
        "create_vm": handle_create_vm,
    }
  • The ALL_HANDLERS dictionary in server.py that merges VM_HANDLERS (among others) into a single dispatch table used by the call_tool handler.
    # Merge all handler dispatch tables
    ALL_HANDLERS: dict[str, Any] = {
        **VM_HANDLERS,
        **CLUSTER_HANDLERS,
        **PE_HANDLERS,
        **REPORT_HANDLERS,
        **NETWORKING_HANDLERS,
    }
  • The list_tools handler in server.py that registers all tool definitions (including create_vm's schema) via the MCP list_tools() decorator.
    @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
        ]
Behavior2/5

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

No annotations exist, so the description carries full burden. It states 'Create' (a mutation) but does not disclose permissions, side effects, or what happens on success/failure. It lacks behavioral details beyond the obvious creation action.

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

Conciseness4/5

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

The description is a single sentence that is concise and front-loads the purpose. However, it could be slightly improved by noting optional parameters, but it remains efficient.

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

Completeness2/5

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

Given the tool creates a resource with 5 parameters and no output schema, the description is too sparse. It does not explain return values, prerequisites (e.g., valid cluster UUID), or post-creation behavior, leaving gaps for an AI agent.

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 description coverage is 100%, so the schema documents each parameter thoroughly. The description adds minimal value by repeating 'name, cluster UUID, and basic specs' but does not clarify relationships or constraints beyond what the schema provides.

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 action ('Create') and the resource ('virtual machine'), and lists required parameters ('name, cluster UUID, and basic specs'). It effectively distinguishes this tool from sibling tools like get_vm and list_vms, which are read-only.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives (e.g., when to use power_on_vm instead). It does not mention prerequisites or contexts where creation is appropriate or not.

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