Skip to main content
Glama
washyu
by washyu

clone_proxmox_vm

Clone Proxmox virtual machines or containers to create new instances for testing, deployment, or backup purposes.

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 that processes tool arguments and calls the clone_proxmox_vm implementation, returning formatted MCP content.
    async def handle_clone_proxmox_vm(arguments: dict[str, Any]) -> dict[str, Any]:
        """Handle clone_proxmox_vm tool."""
        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"),
        )
        return {"content": [{"type": "text", "text": json.dumps(result, indent=2)}]}
  • Core implementation function that performs the actual VM cloning operation via Proxmox REST API, supporting both full and linked clones for VMs (qemu) and containers (lxc).
    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",
    ) -> 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
    
        Returns:
            Clone operation result
        """
        client = get_proxmox_client(host=host)
    
        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: {str(e)}",
            }
  • JSON Schema definition for the clone_proxmox_vm tool, defining input parameters (node, vmid, new_vmid, name, full, vm_type, host) and their types, constraints, and default values.
    "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"],
        },
    },
  • Tool registration mapping clone_proxmox_vm to handle_clone_proxmox_vm function, imported from proxmox_handlers and registered in the TOOL_HANDLERS dictionary.
    from .proxmox_handlers import (
        handle_clone_proxmox_vm,
        handle_create_proxmox_lxc,
        handle_create_proxmox_vm,
        handle_delete_proxmox_vm,
        handle_get_proxmox_node_status,
        handle_get_proxmox_script_info,
        handle_get_proxmox_vm_status,
        handle_list_proxmox_resources,
        handle_manage_proxmox_vm,
        handle_search_proxmox_scripts,
    )
    from .service_handlers import (
        handle_check_ansible_service,
        handle_check_service_requirements,
        handle_destroy_terraform_service,
        handle_get_service_info,
        handle_get_service_status,
        handle_install_service,
        handle_list_available_services,
        handle_plan_terraform_service,
        handle_refresh_terraform_service,
        handle_run_ansible_playbook,
    )
    from .ssh_handlers import (
        handle_setup_mcp_admin,
        handle_ssh_discover,
        handle_ssh_execute_command,
        handle_start_interactive_shell,
        handle_update_mcp_admin_groups,
        handle_verify_mcp_admin,
    )
    from .vm_handlers import (
        handle_control_vm,
        handle_deploy_vm,
        handle_get_vm_logs,
        handle_get_vm_status,
        handle_list_vms,
        handle_remove_vm,
    )
    
    # Type alias for handler functions
    ToolHandler = Callable[[dict[str, Any]], Awaitable[dict[str, Any]]]
    
    # Tool handler registry mapping tool names to their handler functions
    TOOL_HANDLERS: dict[str, ToolHandler] = {
        # SSH tools
        "ssh_discover": handle_ssh_discover,
        "setup_mcp_admin": handle_setup_mcp_admin,
        "verify_mcp_admin": handle_verify_mcp_admin,
        "ssh_execute_command": handle_ssh_execute_command,
        "start_interactive_shell": handle_start_interactive_shell,
        "update_mcp_admin_groups": handle_update_mcp_admin_groups,
        # Network tools
        "discover_and_map": handle_discover_and_map,
        "bulk_discover_and_map": handle_bulk_discover_and_map,
        "get_network_sitemap": handle_get_network_sitemap,
        "analyze_network_topology": handle_analyze_network_topology,
        "suggest_deployments": handle_suggest_deployments,
        "get_device_changes": handle_get_device_changes,
        # Infrastructure tools
        "deploy_infrastructure": handle_deploy_infrastructure,
        "update_device_config": handle_update_device_config,
        "decommission_device": handle_decommission_device,
        "scale_services": handle_scale_services,
        "validate_infrastructure_changes": handle_validate_infrastructure_changes,
        "create_infrastructure_backup": handle_create_infrastructure_backup,
        "rollback_infrastructure_changes": handle_rollback_infrastructure_changes,
        # VM tools
        "deploy_vm": handle_deploy_vm,
        "control_vm": handle_control_vm,
        "get_vm_status": handle_get_vm_status,
        "list_vms": handle_list_vms,
        "get_vm_logs": handle_get_vm_logs,
        "remove_vm": handle_remove_vm,
        # Service tools
        "list_available_services": handle_list_available_services,
        "get_service_info": handle_get_service_info,
        "check_service_requirements": handle_check_service_requirements,
        "install_service": handle_install_service,
        "get_service_status": handle_get_service_status,
        "plan_terraform_service": handle_plan_terraform_service,
        "destroy_terraform_service": handle_destroy_terraform_service,
        "refresh_terraform_service": handle_refresh_terraform_service,
        "check_ansible_service": handle_check_ansible_service,
        "run_ansible_playbook": handle_run_ansible_playbook,
        # Credential tools
        "register_server": handle_register_server,
        "list_registered_servers": handle_list_registered_servers,
        "update_server_credentials": handle_update_server_credentials,
        "remove_server": handle_remove_server,
        # Proxmox tools
        "search_proxmox_scripts": handle_search_proxmox_scripts,
        "get_proxmox_script_info": handle_get_proxmox_script_info,
        "list_proxmox_resources": handle_list_proxmox_resources,
        "get_proxmox_node_status": handle_get_proxmox_node_status,
        "get_proxmox_vm_status": handle_get_proxmox_vm_status,
        "manage_proxmox_vm": handle_manage_proxmox_vm,
        "create_proxmox_lxc": handle_create_proxmox_lxc,
        "create_proxmox_vm": handle_create_proxmox_vm,
        "clone_proxmox_vm": handle_clone_proxmox_vm,
        "delete_proxmox_vm": handle_delete_proxmox_vm,
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as required permissions, whether cloning is destructive to the source, rate limits, or what happens on failure. This is inadequate for a mutation tool with zero annotation coverage.

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 with zero waste, clearly front-loading the purpose. It's appropriately sized for the tool's complexity.

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's complexity (mutation with 7 parameters), no annotations, and no output schema, the description is incomplete. It lacks details on behavioral context, error handling, and output expectations, making it insufficient for safe and effective use by 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 fully documents all 7 parameters. The description adds no additional meaning beyond implying cloning from a source to a new VM/container, which is already clear from the schema. Baseline 3 is appropriate as the 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 ('clone') and target resource ('VM or container'), specifying it creates a new one. It distinguishes from siblings like 'create_proxmox_vm' by focusing on cloning rather than creation from scratch, but doesn't explicitly contrast with similar tools like 'manage_proxmox_vm'.

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 use this tool versus alternatives like 'create_proxmox_vm' or 'manage_proxmox_vm' is provided. The description implies usage for cloning scenarios but lacks explicit context, prerequisites, or exclusions.

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