Skip to main content
Glama

export_vm

Export a virtual machine to a .utm file for backup, sharing, or migration.

Instructions

Export a VM to a .utm file.

Args: name: VM name path: Destination file path (e.g. "/tmp/my-vm.utm")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
pathYes

Implementation Reference

  • MCP tool handler for 'export_vm'. Decorated with @mcp.tool(), delegates to utm.export_vm().
    def export_vm(name: str, path: str) -> dict:
        """Export a VM to a .utm file.
    
        Args:
            name: VM name
            path: Destination file path (e.g. "/tmp/my-vm.utm")
        """
        utm.export_vm(name, path)
        return {"name": name, "exported_to": path}
  • Core AppleScript implementation of export_vm. Validates name/path, builds AppleScript to export VM via UTM app, runs osascript with 600s timeout.
    def export_vm(name: str, path: str) -> bool:
        """Export a VM to a .utm file at the given path."""
        _validate_vm_name(name)
        _validate_path(path)
        script = f'''
        tell application "UTM"
            set vm to virtual machine named "{_esc(name)}"
            set dest to POSIX file "{_esc(path)}"
            export vm to dest
        end tell
        '''
        _run(script, timeout=600)
        return True
  • Registration via @mcp.tool() decorator on the export_vm function in server.py.
    @mcp.tool()
    def export_vm(name: str, path: str) -> dict:
  • Validation helper _validate_path used by export_vm to ensure absolute path and no path traversal.
    def _validate_path(path: str) -> str:
        if not path.startswith("/"):
            raise ValueError(f"Path must be absolute: {path!r}")
        if ".." in path.split("/"):
            raise ValueError(f"Path traversal not allowed: {path!r}")
        return path
  • Validation helper _validate_vm_name used by export_vm to validate VM name format.
    def _validate_vm_name(name: str) -> str:
        if not name or not _VM_NAME_RE.match(name):
            raise ValueError(f"Invalid VM name: {name!r} — only word characters, spaces, hyphens, and dots allowed")
Behavior2/5

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

No annotations provided. Description only states action without disclosing side effects (e.g., whether VM is locked, if state must be off, or if export modifies the VM). Minimal behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Short single sentence plus minimal Args list. No wasted words; adequately front-loaded. Could benefit from structured use of description to include more details without adding length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 simple params and no output schema or annotations, the description covers basic function. However, missing details like VM state requirements, synchronous/asynchronous behavior, and output format confirmation limit completeness.

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?

With 0% schema coverage, description adds basic parameter meaning (VM name, path example) but lacks constraints like path format, required permissions, or file extension details. Adds some value but insufficient for full understanding.

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?

Clear verb+resource: 'Export a VM to a .utm file.' Distinguishes from siblings like clone_vm (creates copy) and import_vm (opposite operation).

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 (e.g., may require VM to be stopped, compare to clone_vm). The description lacks context for proper 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/neverprepared/mcp-utm'

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