Skip to main content
Glama

start_vm

Resume a stopped or suspended virtual machine, powering it on to restore its operational state.

Instructions

Start a stopped or suspended VM.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • MCP tool handler for start_vm. Decorated with @mcp.tool(). Calls utm.start_vm(name) and returns the resulting status.
    @mcp.tool()
    def start_vm(name: str) -> dict:
        """Start a stopped or suspended VM."""
        status = utm.start_vm(name)
        return {"name": name, "status": status}
  • Core implementation of start_vm. Validates the VM name, then runs an AppleScript via osascript that tells UTM to start the VM and returns its status.
    def start_vm(name: str) -> str:
        """Start a VM. Returns status after start command."""
        _validate_vm_name(name)
        script = f'''
        tell application "UTM"
            set vm to virtual machine named "{_esc(name)}"
            start vm
            return status of vm as text
        end tell
        '''
        return _run(script, timeout=60)
  • Registration: the @mcp.tool() decorator registers start_vm as a tool on the FastMCP server.
    @mcp.tool()
  • Validation helper _validate_vm_name ensures VM name contains only allowed characters before starting.
    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")
        return name
  • The _run helper executes AppleScript via subprocess (osascript), used by start_vm to issue the 'start vm' command.
    def _run(script: str, timeout: int = 30) -> str:
        """Execute an AppleScript snippet and return stdout."""
        result = subprocess.run(
            ["osascript", "-e", script],
            capture_output=True,
            text=True,
            timeout=timeout,
        )
        if result.returncode != 0:
            err = result.stderr.strip()
            if "Application can" in err and "found" in err:
                raise RuntimeError("UTM is not running. Launch UTM and try again.")
            raise RuntimeError(err or f"osascript failed (rc={result.returncode})")
        return result.stdout.strip()
Behavior2/5

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

Without annotations, the description bears full burden. It only states the action 'start' but does not disclose behavioral traits like potential delays, permission requirements, or side effects. Minimal 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, well-front-loaded sentence with no extraneous words. Every word contributes meaning.

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?

For a simple tool with one parameter and no output schema, the description covers the core action but omits parameter clarification and usage context, making it minimally adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'name' has 0% schema description coverage, and the tool description does not clarify whether it refers to VM name, ID, or path, leaving the agent to guess its semantics.

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?

The description specifies the action ('start'), the resource ('VM'), and the applicable states ('stopped or suspended'), clearly distinguishing from sibling tools like stop_vm and suspend_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 is provided on when to use this tool vs alternatives, such as when a VM is already running or prerequisites like VM existence. The description lacks context for appropriate invocation.

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