Skip to main content
Glama
washyu
by washyu

create_proxmox_vm

Create virtual machines on Proxmox servers for homelab infrastructure management. Specify VM configuration including CPU, memory, storage, and optional ISO installation.

Instructions

Create a new VM (QEMU) on Proxmox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeYesNode name
vmidYesVM ID (must be unique)
nameYesVM name
memoryNoRAM in MB
coresNoNumber of CPU cores
disk_sizeNoDisk size in GB
storageNoStorage for diskslocal-lvm
isoNoISO image to attach (e.g., 'local:iso/debian-12.iso')
startNoStart VM after creation
hostNoProxmox host (optional)

Implementation Reference

  • Main implementation of create_proxmox_vm - creates a new QEMU VM on Proxmox with configurable memory, cores, storage, disk size, and optional ISO attachment. Includes logic to start the VM after creation if requested.
    async def create_proxmox_vm(
        node: str,
        vmid: int,
        name: str,
        host: str | None = None,
        memory: int = 2048,
        cores: int = 2,
        sockets: int = 1,
        storage: str = "local-lvm",
        disk_size: int = 32,
        iso: str | None = None,
        cdrom: str | None = None,
        net0: str = "virtio,bridge=vmbr0",
        ostype: str = "l26",
        start: bool = False,
        **kwargs: Any,
    ) -> dict[str, Any]:
        """
        Create a new VM (QEMU).
    
        Args:
            node: Node name
            vmid: VM ID
            name: VM name
            host: Proxmox host (optional)
            memory: RAM in MB
            cores: Number of CPU cores
            sockets: Number of CPU sockets
            storage: Storage for disks
            disk_size: Disk size in GB
            iso: ISO image to attach
            cdrom: CDROM image
            net0: Network configuration
            ostype: OS type
            start: Start after creation
            **kwargs: Additional VM parameters
    
        Returns:
            Creation result
        """
        client = get_proxmox_client(host=host)
    
        try:
            # Build VM config
            config: dict[str, Any] = {
                "vmid": vmid,
                "name": name,
                "memory": memory,
                "cores": cores,
                "sockets": sockets,
                "scsi0": f"{storage}:{disk_size}",
                "net0": net0,
                "ostype": ostype,
            }
    
            if iso:
                config["ide2"] = f"{iso},media=cdrom"
            elif cdrom:
                config["cdrom"] = cdrom
    
            # Add any additional parameters
            config.update(kwargs)
    
            result = await client.post(f"/nodes/{node}/qemu", config)
    
            # Start if requested
            if start and result:
                await manage_proxmox_vm(node, vmid, "start", host, "qemu")
    
            return {
                "status": "success",
                "node": node,
                "vmid": vmid,
                "name": name,
                "message": f"VM {vmid} created successfully",
                "data": result,
            }
    
        except (aiohttp.ClientError, ValueError) as e:
            logger.error("Error creating VM: %s", str(e))
            return {
                "status": "error",
                "message": f"Failed to create VM: {str(e)}",
            }
  • MCP tool handler wrapper for create_proxmox_vm - parses arguments from the tool call and passes them to the underlying create_proxmox_vm function, then formats the response as JSON content.
    async def handle_create_proxmox_vm(arguments: dict[str, Any]) -> dict[str, Any]:
        """Handle create_proxmox_vm tool."""
        result = await create_proxmox_vm(
            node=arguments["node"],
            vmid=arguments["vmid"],
            name=arguments["name"],
            host=arguments.get("host"),
            memory=arguments.get("memory", 2048),
            cores=arguments.get("cores", 2),
            storage=arguments.get("storage", "local-lvm"),
            disk_size=arguments.get("disk_size", 32),
            iso=arguments.get("iso"),
            start=arguments.get("start", False),
        )
        return {"content": [{"type": "text", "text": json.dumps(result, indent=2)}]}
  • Tool registration mapping 'create_proxmox_vm' to its handler function handle_create_proxmox_vm in the TOOL_HANDLERS registry.
    "create_proxmox_vm": handle_create_proxmox_vm,
  • Input/output schema definition for create_proxmox_vm tool - defines required parameters (node, vmid, name) and optional parameters (memory, cores, disk_size, storage, iso, start, host) with their types, descriptions, and default values.
    "create_proxmox_vm": {
        "description": "Create a new VM (QEMU) on Proxmox",
        "inputSchema": {
            "type": "object",
            "properties": {
                "node": {
                    "type": "string",
                    "description": "Node name",
                },
                "vmid": {
                    "type": "integer",
                    "description": "VM ID (must be unique)",
                },
                "name": {
                    "type": "string",
                    "description": "VM name",
                },
                "memory": {
                    "type": "integer",
                    "description": "RAM in MB",
                    "default": 2048,
                },
                "cores": {
                    "type": "integer",
                    "description": "Number of CPU cores",
                    "default": 2,
                },
                "disk_size": {
                    "type": "integer",
                    "description": "Disk size in GB",
                    "default": 32,
                },
                "storage": {
                    "type": "string",
                    "description": "Storage for disks",
                    "default": "local-lvm",
                },
                "iso": {
                    "type": "string",
                    "description": "ISO image to attach (e.g., 'local:iso/debian-12.iso')",
                },
                "start": {
                    "type": "boolean",
                    "description": "Start VM after creation",
                    "default": False,
                },
                "host": {
                    "type": "string",
                    "description": "Proxmox host (optional)",
                },
            },
            "required": ["node", "vmid", "name"],
        },
    },
  • Helper function get_proxmox_client - retrieves or creates a ProxmoxAPIClient instance using credentials from environment variables or parameters, used by create_proxmox_vm to authenticate API requests.
    def get_proxmox_client(
        host: str | None = None,
        port: int = 8006,
        verify_ssl: bool | None = None,
        username: str | None = None,
        password: str | None = None,
        api_token: str | None = None,
    ) -> ProxmoxAPIClient:
        """
        Get a Proxmox API client with credentials from environment or parameters.
    
        Args:
            host: Proxmox host (defaults to PROXMOX_HOST env var)
            port: API port (default: 8006)
            verify_ssl: Verify SSL (defaults to PROXMOX_VERIFY_SSL env var)
            username: Username (defaults to PROXMOX_USER env var)
            password: Password (defaults to PROXMOX_PASSWORD env var)
            api_token: API token (defaults to PROXMOX_API_TOKEN env var)
    
        Returns:
            Configured ProxmoxAPIClient instance
        """
        # Get from environment if not provided
        host = host or os.getenv("PROXMOX_HOST")
        if not host:
            raise ValueError("Proxmox host must be provided or set in PROXMOX_HOST env var")
    
        if verify_ssl is None:
            verify_ssl = os.getenv("PROXMOX_VERIFY_SSL", "false").lower() == "true"
    
        username = username or os.getenv("PROXMOX_USER")
        password = password or os.getenv("PROXMOX_PASSWORD")
        api_token = api_token or os.getenv("PROXMOX_API_TOKEN")
    
        # Must have either API token or username+password
        if not api_token and not (username and password):
            raise ValueError("Must provide either PROXMOX_API_TOKEN or PROXMOX_USER+PROXMOX_PASSWORD")
    
        return ProxmoxAPIClient(
            host=host,
            port=port,
            verify_ssl=verify_ssl,
            username=username,
            password=password,
            api_token=api_token,
        )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Create') but doesn't mention critical behavioral aspects: whether this is a destructive operation, what permissions are required, how long it takes, whether it's idempotent, or what happens on failure. For a VM creation tool with zero annotation coverage, this is a significant gap.

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 a single, efficient sentence that states exactly what the tool does with zero wasted words. It's appropriately sized for a creation tool and front-loads the core functionality without unnecessary elaboration.

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?

For a complex VM creation tool with 10 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, what happens on success/failure, or important behavioral constraints. The agent would need to guess about the operation's impact and results.

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 already documents all 10 parameters thoroughly with descriptions and defaults. The description adds no additional parameter semantics beyond what's in the schema, meeting the baseline expectation when schema does the heavy lifting.

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

Purpose4/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 resource ('new VM (QEMU) on Proxmox'), making the purpose immediately understandable. It distinguishes from sibling tools like 'create_proxmox_lxc' by specifying VM type, but doesn't explicitly differentiate from 'deploy_vm' or 'manage_proxmox_vm', which might have overlapping functionality.

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 like 'clone_proxmox_vm', 'deploy_vm', or 'manage_proxmox_vm'. It doesn't mention prerequisites, constraints, or typical use cases, leaving the agent to infer usage from the tool name alone.

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/washyu/mcp_python_server'

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