Skip to main content
Glama

start_vm

Power on a stopped or suspended virtual machine managed by UTM via MCP.

Instructions

Start a stopped or suspended VM.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • Core handler: executes AppleScript to start a UTM VM via osascript and returns the status string.
    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)
  • MCP tool handler: decorated with @mcp.tool(), delegates to applescript.start_vm() and wraps the result in a dict.
    @mcp.tool()
    def start_vm(name: str) -> dict:
        """Start a stopped or suspended VM."""
        status = utm.start_vm(name)
        return {"name": name, "status": status}
  • Registration of 'start_vm' as an MCP tool via the @mcp.tool() decorator on FastMCP instance.
    @mcp.tool()
  • Input validation helper: ensures VM name only contains safe characters before AppleScript interpolation.
    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
  • Helper: executes AppleScript via subprocess (osascript), with timeout and error handling.
    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?

No annotations are provided, so the description must disclose behavioral traits. It only states the operation's input condition but does not mention whether the operation is synchronous, what the return value is, or any permissions required.

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 no unnecessary words. It is front-loaded and effective.

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 no annotations, output schema, or parameter descriptions, the description is too minimal. It fails to convey important details such as whether the VM must exist, the effect on the VM state, or potential error conditions.

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?

The schema has one parameter with 0% coverage. The description adds context by implying the parameter refers to a VM name or ID, but does not explicitly describe the parameter's format, constraints, or examples.

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 clearly states the action ('Start') and the resource ('VM'), and specifies the relevant states ('stopped or suspended'). It distinguishes the tool from siblings 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the VM state requirement ('stopped or suspended'), but no explicit guidance on when to use this versus alternatives like resume or power-on is given. The description lacks 'when-not' scenarios.

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