Skip to main content
Glama
washyu
by washyu

delete_proxmox_vm

Remove virtual machines or containers from Proxmox VE by specifying node and VM ID. Supports qemu VMs and LXC containers with optional configuration cleanup.

Instructions

Delete a VM or container from Proxmox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeYesNode name
vmidYesVM/Container ID to delete
vm_typeNoType: 'qemu' for VM or 'lxc' for containerqemu
purgeNoRemove from all related configurations
hostNoProxmox host (optional)

Implementation Reference

  • Core implementation of delete_proxmox_vm that stops the VM/container if running, then deletes it via Proxmox API. Supports both VMs (qemu) and containers (lxc), with optional purge to remove from all related configurations.
    async def delete_proxmox_vm(
        node: str,
        vmid: int,
        host: str | None = None,
        vm_type: str = "qemu",
        purge: bool = False,
    ) -> dict[str, Any]:
        """
        Delete a VM or container.
    
        Args:
            node: Node name
            vmid: VM/Container ID
            host: Proxmox host (optional)
            vm_type: 'qemu' for VM or 'lxc' for container
            purge: Remove from all related configurations
    
        Returns:
            Deletion result
        """
        client = get_proxmox_client(host=host)
    
        try:
            # Stop VM first if running
            try:
                await manage_proxmox_vm(node, vmid, "stop", host, vm_type)
            except Exception:
                pass  # VM might already be stopped
    
            # Delete
            endpoint = f"/nodes/{node}/{vm_type}/{vmid}"
            if purge:
                endpoint += "?purge=1"
    
            result = await client.delete(endpoint)
    
            return {
                "status": "success",
                "node": node,
                "vmid": vmid,
                "message": f"VM {vmid} deleted successfully",
                "data": result,
            }
    
        except (aiohttp.ClientError, ValueError) as e:
            logger.error("Error deleting VM: %s", str(e))
            return {
                "status": "error",
                "message": f"Failed to delete VM: {str(e)}",
            }
  • MCP tool handler wrapper that extracts arguments from the tool call and invokes the delete_proxmox_vm function, returning the result in MCP protocol format.
    async def handle_delete_proxmox_vm(arguments: dict[str, Any]) -> dict[str, Any]:
        """Handle delete_proxmox_vm tool."""
        result = await delete_proxmox_vm(
            node=arguments["node"],
            vmid=arguments["vmid"],
            host=arguments.get("host"),
            vm_type=arguments.get("vm_type", "qemu"),
            purge=arguments.get("purge", False),
        )
        return {"content": [{"type": "text", "text": json.dumps(result, indent=2)}]}
  • Tool registration mapping 'delete_proxmox_vm' to its handler function in the tool handlers registry.
    "delete_proxmox_vm": handle_delete_proxmox_vm,
  • Schema definition for delete_proxmox_vm tool, specifying input parameters (node, vmid, vm_type, purge, host) with types, descriptions, defaults, and required fields.
    "delete_proxmox_vm": {
        "description": "Delete a VM or container from Proxmox",
        "inputSchema": {
            "type": "object",
            "properties": {
                "node": {
                    "type": "string",
                    "description": "Node name",
                },
                "vmid": {
                    "type": "integer",
                    "description": "VM/Container ID to delete",
                },
                "vm_type": {
                    "type": "string",
                    "description": "Type: 'qemu' for VM or 'lxc' for container",
                    "enum": ["qemu", "lxc"],
                    "default": "qemu",
                },
                "purge": {
                    "type": "boolean",
                    "description": "Remove from all related configurations",
                    "default": False,
                },
                "host": {
                    "type": "string",
                    "description": "Proxmox host (optional)",
                },
            },
            "required": ["node", "vmid"],
        },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is 'Delete', implying a destructive operation, but doesn't mention critical details like whether deletion is irreversible, requires specific permissions, or has side effects on related resources. This is a significant gap for a mutation 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?

The description is a single, direct sentence with zero waste—it states the core action and target efficiently. It's front-loaded with the verb 'Delete', making the tool's purpose immediately clear 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 destructive tool with no annotations and no output schema, the description is inadequate. It doesn't cover behavioral risks, return values, or error conditions. Given the complexity of deleting a VM/container and the lack of structured data, more context is needed to ensure safe and correct usage.

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 5 parameters. The description adds no additional semantic context beyond what's in the schema, such as explaining the relationship between 'node' and 'vmid' or the implications of 'purge'. Baseline 3 is appropriate when 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 ('Delete') and target ('a VM or container from Proxmox'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'remove_vm' or 'decommission_device', which might have similar functions but different contexts or implementations.

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 'remove_vm' or 'decommission_device' from the sibling list. It lacks context about prerequisites, such as needing the VM to be stopped first, or exclusions, leaving the agent to guess based on tool names 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