Skip to main content
Glama

list_vms

List all UTM virtual machines on macOS and display their current status.

Instructions

List all registered UTM virtual machines with their status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Actual implementation of list_vms — executes AppleScript to iterate UTM virtual machines, parsing output into VMInfo objects (id, name, status, backend). This is the core logic that queries UTM via osascript.
    def list_vms() -> list[VMInfo]:
        """List all registered UTM virtual machines."""
        script = '''
        tell application "UTM"
            set output to ""
            repeat with vm in virtual machines
                set vmId to id of vm
                set vmName to name of vm
                set vmStatus to status of vm as text
                set vmBackend to backend of vm as text
                set output to output & vmId & "||" & vmName & "||" & vmStatus & "||" & vmBackend & linefeed
            end repeat
            return output
        end tell
        '''
        raw = _run(script)
        vms = []
        for line in raw.strip().split("\n"):
            line = line.strip()
            if not line:
                continue
            parts = line.split("||")
            if len(parts) >= 4:
                vms.append(VMInfo(id=parts[0], name=parts[1], status=parts[2], backend=parts[3]))
        return vms
  • VMInfo dataclass — defines the data model returned by list_vms (id, name, status, backend fields with to_dict method).
    @dataclass
    class VMInfo:
        id: str
        name: str
        status: str
        backend: str
    
        def to_dict(self) -> dict:
            return {"id": self.id, "name": self.name, "status": self.status, "backend": self.backend}
  • MCP tool handler for list_vms — decorated with @mcp.tool(), delegates to applescript.list_vms() and converts results to dicts.
    @mcp.tool()
    def list_vms() -> list[dict]:
        """List all registered UTM virtual machines with their status."""
        return [vm.to_dict() for vm in utm.list_vms()]
  • Registration via @mcp.tool() decorator — registers 'list_vms' as an MCP tool on the FastMCP server instance.
    @mcp.tool()
    def list_vms() -> list[dict]:
        """List all registered UTM virtual machines with their status."""
        return [vm.to_dict() for vm in utm.list_vms()]
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It only states a basic list action without mentioning any behavioral traits such as that it's read-only, performance implications, or authentication needs.

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 short sentence that is front-loaded and contains no superfluous information. Every word earns its place.

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

Completeness5/5

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

Given the tool's simplicity (no parameters, read-only listing), the description is complete. An output schema exists, so return values need not be elaborated. The description covers the essential scope.

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?

The input schema has zero parameters and schema description coverage is 100%. The description adds no parameter info because none exist, which is appropriate. Baseline 4 is suitable for a parameterless tool.

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 specifies the verb 'List', the resource 'registered UTM virtual machines', and the returned information 'with their status'. This distinguishes it from sibling tools like get_vm (single VM) and other list tools.

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 explicit guidance on when to use this tool versus alternatives. While it's implied that it's for listing all VMs, there is no mention of exclusions or alternatives (e.g., for specific VM use get_vm).

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