Skip to main content
Glama

suspend_vm

Suspend a running virtual machine to memory, optionally saving its state to disk for later resume.

Instructions

Suspend a running VM to memory.

Args: name: VM name (must be running) save: Save VM state to disk for later resume (default: True)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
saveNo

Implementation Reference

  • MCP tool handler for suspend_vm - decorated with @mcp.tool(), calls utm.suspend_vm() and returns the result.
    def suspend_vm(name: str, save: bool = True) -> dict:
        """Suspend a running VM to memory.
    
        Args:
            name: VM name (must be running)
            save: Save VM state to disk for later resume (default: True)
        """
        status = utm.suspend_vm(name, save=save)
        return {"name": name, "status": status}
  • Core AppleScript implementation of suspend_vm - executes osascript to suspend a UTM VM (with or without saving state).
    def suspend_vm(name: str, save: bool = True) -> str:
        """Suspend a running VM to memory. Optionally save state to disk."""
        _validate_vm_name(name)
        saving = "with saving" if save else "without saving"
        script = f'''
        tell application "UTM"
            set vm to virtual machine named "{_esc(name)}"
            suspend vm {saving}
            return status of vm as text
        end tell
        '''
        return _run(script, timeout=60)
  • Registration as MCP tool via @mcp.tool() decorator on line 123 in server.py.
    def suspend_vm(name: str, save: bool = True) -> dict:
  • The _run() helper that executes AppleScript via osascript subprocess.
    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()
Behavior3/5

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

The description explains suspends to memory and the save parameter's effect, but lacks details on side effects like pausing, network state, or no explicit mention of return behavior. With no annotations, more depth would be beneficial.

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?

Two succinct sentences with no filler. The key information is front-loaded and each sentence adds value. Efficient use of space.

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 2 parameters and no output schema, the description covers the basics. However, it lacks information on return values, error conditions, or prerequisites beyond 'must be running'. Could be more thorough.

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

Parameters4/5

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

Despite 0% schema description coverage, the description adds meaningful parameter semantics: 'name: VM name (must be running)' clarifies requirement, and 'save: Save VM state to disk...' explains the boolean parameter. This compensates well.

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 'Suspend a running VM to memory', specifying the action (suspend) and resource (VM). It distinguishes from sibling tools like stop_vm and start_vm by focusing on suspension to memory.

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?

The description mentions 'name: VM name (must be running)' implying the VM must be running, but does not explicitly state when to use it over alternatives like stop_vm or when not to use it. No comparative guidance is provided.

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