Skip to main content
Glama
washyu
by washyu

create_proxmox_lxc

Create new LXC containers on Proxmox for homelab infrastructure management, specifying node, container ID, hostname, and resource configurations.

Instructions

Create a new LXC container on Proxmox

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeYesNode name
vmidYesContainer ID (must be unique)
hostnameYesContainer hostname
ostemplateNoTemplate (e.g., 'local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst')local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst
storageNoStorage for rootfslocal-lvm
memoryNoRAM in MB
coresNoNumber of CPU cores
rootfs_sizeNoRoot filesystem size in GB
passwordNoRoot password
startNoStart container after creation
hostNoProxmox host (optional)

Implementation Reference

  • MCP tool handler that receives arguments from the tool request and calls the create_proxmox_lxc API function with proper parameter extraction and JSON response formatting
    async def handle_create_proxmox_lxc(arguments: dict[str, Any]) -> dict[str, Any]:
        """Handle create_proxmox_lxc tool."""
        result = await create_proxmox_lxc(
            node=arguments["node"],
            vmid=arguments["vmid"],
            hostname=arguments["hostname"],
            host=arguments.get("host"),
            ostemplate=arguments.get("ostemplate", "local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst"),
            storage=arguments.get("storage", "local-lvm"),
            memory=arguments.get("memory", 512),
            cores=arguments.get("cores", 1),
            rootfs_size=arguments.get("rootfs_size", 8),
            password=arguments.get("password"),
            start=arguments.get("start", False),
        )
        return {"content": [{"type": "text", "text": json.dumps(result, indent=2)}]}
  • Core implementation function that creates a Proxmox LXC container by building configuration, making POST request to Proxmox API at /nodes/{node}/lxc endpoint, and returning formatted result
    async def create_proxmox_lxc(
        node: str,
        vmid: int,
        hostname: str,
        host: str | None = None,
        ostemplate: str = "local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst",
        storage: str = "local-lvm",
        memory: int = 512,
        swap: int = 512,
        cores: int = 1,
        rootfs_size: int = 8,
        password: str | None = None,
        ssh_public_keys: str | None = None,
        unprivileged: bool = True,
        start: bool = False,
        **kwargs: Any,
    ) -> dict[str, Any]:
        """
        Create a new LXC container.
    
        Args:
            node: Node name
            vmid: Container ID
            hostname: Container hostname
            host: Proxmox host (optional)
            ostemplate: Template to use
            storage: Storage for rootfs
            memory: RAM in MB
            swap: Swap in MB
            cores: Number of CPU cores
            rootfs_size: Root filesystem size in GB
            password: Root password
            ssh_public_keys: SSH public keys
            unprivileged: Create unprivileged container
            start: Start after creation
            **kwargs: Additional LXC parameters
    
        Returns:
            Creation result
        """
        client = get_proxmox_client(host=host)
    
        try:
            # Build container config
            config: dict[str, Any] = {
                "vmid": vmid,
                "hostname": hostname,
                "ostemplate": ostemplate,
                "storage": storage,
                "memory": memory,
                "swap": swap,
                "cores": cores,
                "rootfs": f"{storage}:{rootfs_size}",
                "unprivileged": 1 if unprivileged else 0,
                "start": 1 if start else 0,
            }
    
            if password:
                config["password"] = password
            if ssh_public_keys:
                config["ssh-public-keys"] = ssh_public_keys
    
            # Add any additional parameters
            config.update(kwargs)
    
            result = await client.post(f"/nodes/{node}/lxc", config)
    
            return {
                "status": "success",
                "node": node,
                "vmid": vmid,
                "hostname": hostname,
                "message": f"LXC container {vmid} created successfully",
                "data": result,
            }
    
        except (aiohttp.ClientError, ValueError) as e:
            logger.error("Error creating LXC container: %s", str(e))
            return {
                "status": "error",
                "message": f"Failed to create LXC container: {str(e)}",
            }
  • Input schema definition for create_proxmox_lxc tool, specifying required parameters (node, vmid, hostname) and optional parameters (ostemplate, storage, memory, cores, rootfs_size, password, start, host) with their types and defaults
    "create_proxmox_lxc": {
        "description": "Create a new LXC container on Proxmox",
        "inputSchema": {
            "type": "object",
            "properties": {
                "node": {
                    "type": "string",
                    "description": "Node name",
                },
                "vmid": {
                    "type": "integer",
                    "description": "Container ID (must be unique)",
                },
                "hostname": {
                    "type": "string",
                    "description": "Container hostname",
                },
                "ostemplate": {
                    "type": "string",
                    "description": "Template (e.g., 'local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst')",
                    "default": "local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst",
                },
                "storage": {
                    "type": "string",
                    "description": "Storage for rootfs",
                    "default": "local-lvm",
                },
                "memory": {
                    "type": "integer",
                    "description": "RAM in MB",
                    "default": 512,
                },
                "cores": {
                    "type": "integer",
                    "description": "Number of CPU cores",
                    "default": 1,
                },
                "rootfs_size": {
                    "type": "integer",
                    "description": "Root filesystem size in GB",
                    "default": 8,
                },
                "password": {
                    "type": "string",
                    "description": "Root password",
                },
                "start": {
                    "type": "boolean",
                    "description": "Start container after creation",
                    "default": False,
                },
                "host": {
                    "type": "string",
                    "description": "Proxmox host (optional)",
                },
            },
            "required": ["node", "vmid", "hostname"],
        },
    },
  • Import statement for handle_create_proxmox_lxc handler function
    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,
    )
  • Registration mapping the tool name 'create_proxmox_lxc' to its handler function in the TOOL_HANDLERS dictionary
    "create_proxmox_lxc": handle_create_proxmox_lxc,
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Create' which implies a write/mutation operation, but doesn't disclose behavioral traits like required permissions, whether creation is idempotent, potential side effects (e.g., resource allocation), or error handling. For a complex creation tool with 11 parameters, this is a significant gap in transparency.

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, clear sentence that directly states the tool's purpose without any fluff. It's appropriately sized and front-loaded, making it efficient for quick comprehension.

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 creation tool with 11 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what happens after creation (e.g., returns container details, status), error conditions, or system requirements. Given the lack of structured data, more contextual information would be helpful for safe invocation.

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%, providing detailed descriptions for all 11 parameters. The description adds no additional parameter information beyond the schema, so it doesn't enhance understanding of parameter semantics. Baseline 3 is appropriate when the schema does all 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 LXC container on Proxmox'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'create_proxmox_vm' or 'clone_proxmox_vm', which would require specifying that this is specifically for LXC containers versus VMs or cloning operations.

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. It doesn't mention prerequisites (e.g., needing Proxmox access), compare to similar tools like 'create_proxmox_vm', or specify use cases (e.g., for lightweight container deployment). This leaves the agent without context for tool selection.

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