Skip to main content
Glama
washyu
by washyu

clone_proxmox_vm

Clone a Proxmox VM or container to create a new instance. Specify source and new VM IDs for the clone.

Instructions

Clone a VM or container to create a new one

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeYesNode name
vmidYesSource VM/Container ID
new_vmidYesNew VM/Container ID
nameNoNew VM name (optional)
fullNoFull clone (true) or linked clone (false)
vm_typeNoType: 'qemu' for VM or 'lxc' for containerqemu
hostNoProxmox host (optional)

Implementation Reference

  • Handler function for clone_proxmox_vm tool. Validates hostname, calls the API function clone_proxmox_vm, and returns formatted response.
    async def handle_clone_proxmox_vm(arguments: dict[str, Any]) -> dict[str, Any]:
        """Handle clone_proxmox_vm tool."""
        from ..server import get_resource_manager
    
        if host := arguments.get("host"):
            validate_hostname(host)
        result = await clone_proxmox_vm(
            node=arguments["node"],
            vmid=arguments["vmid"],
            new_vmid=arguments["new_vmid"],
            host=arguments.get("host"),
            name=arguments.get("name"),
            full=arguments.get("full", True),
            vm_type=arguments.get("vm_type", "qemu"),
            session=get_resource_manager().proxmox_session,
        )
        return {"content": [{"type": "text", "text": json.dumps(result, indent=2)}]}
  • Core API function that performs the actual Proxmox clone operation via REST API POST request to /nodes/{node}/{vm_type}/{vmid}/clone.
    async def clone_proxmox_vm(
        node: str,
        vmid: int,
        new_vmid: int,
        host: str | None = None,
        name: str | None = None,
        full: bool = True,
        vm_type: str = "qemu",
        session: aiohttp.ClientSession | None = None,
    ) -> dict[str, Any]:
        """
        Clone a VM or container.
    
        Args:
            node: Node name
            vmid: Source VM/Container ID
            new_vmid: New VM/Container ID
            host: Proxmox host (optional)
            name: New VM name
            full: Full clone (True) or linked clone (False)
            vm_type: 'qemu' for VM or 'lxc' for container
            session: Optional shared aiohttp.ClientSession (from ResourceManager)
    
        Returns:
            Clone operation result
        """
        client = await get_proxmox_client(host=host, session=session)
    
        try:
            config: dict[str, Any] = {
                "newid": new_vmid,
                "full": 1 if full else 0,
            }
    
            if name:
                config["name"] = name
    
            result = await client.post(f"/nodes/{node}/{vm_type}/{vmid}/clone", config)
    
            return {
                "status": "success",
                "node": node,
                "source_vmid": vmid,
                "new_vmid": new_vmid,
                "message": f"VM {vmid} cloned to {new_vmid} successfully",
                "data": result,
            }
    
        except (aiohttp.ClientError, ValueError) as e:
            logger.error("Error cloning VM: %s", str(e))
            return {
                "status": "error",
                "message": f"Failed to clone VM: {sanitize_error(e)}",
            }
  • Input schema for clone_proxmox_vm tool defining parameters: node, vmid, new_vmid, name, full, vm_type, host.
    "clone_proxmox_vm": {
        "description": "Clone a VM or container to create a new one",
        "inputSchema": {
            "type": "object",
            "properties": {
                "node": {
                    "type": "string",
                    "description": "Node name",
                },
                "vmid": {
                    "type": "integer",
                    "description": "Source VM/Container ID",
                },
                "new_vmid": {
                    "type": "integer",
                    "description": "New VM/Container ID",
                },
                "name": {
                    "type": "string",
                    "description": "New VM name (optional)",
                },
                "full": {
                    "type": "boolean",
                    "description": "Full clone (true) or linked clone (false)",
                    "default": True,
                },
                "vm_type": {
                    "type": "string",
                    "description": "Type: 'qemu' for VM or 'lxc' for container",
                    "enum": ["qemu", "lxc"],
                    "default": "qemu",
                },
                "host": {
                    "type": "string",
                    "description": "Proxmox host (optional)",
                },
            },
            "required": ["node", "vmid", "new_vmid"],
        },
    },
  • Registration of clone_proxmox_vm handler in the TOOL_HANDLERS dictionary.
    "clone_proxmox_vm": handle_clone_proxmox_vm,
  • Tool annotations for clone_proxmox_vm marking it as not read-only, destructive, or idempotent.
    "clone_proxmox_vm": ToolAnnotations(
        readOnlyHint=False,
        destructiveHint=False,
        idempotentHint=False,
    ),
Behavior2/5

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

Annotations already indicate readOnly=false, destructiveHint=false. Description adds no extra behavioral context such as resource consumption, dependency on original, or execution time.

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?

One short sentence clearly stating purpose. No wasted words, directly front-loaded.

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 lack of output schema and moderate parameter count (7), the description should mention return value, status, or whether the operation is synchronous. It does not, leaving agents uninformed about the result.

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 covers all 7 parameters with descriptions. The tool description does not add any parameter-specific details beyond the schema, so baseline score of 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 the tool clones a VM or container to create a new one. This verb+resource combination distinguishes it from sibling 'create' tools which build from scratch.

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?

No guidance on when to clone vs create, or when to use linked vs full clone. No mention of prerequisites or alternatives.

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/homelab_mcp'

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