Skip to main content
Glama

get_vm

Retrieve the status and configuration of a named virtual machine managed by UTM.

Instructions

Get status and configuration of a VM by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • The MCP tool handler for 'get_vm'. It calls utm.get_vm_status() and utm.get_vm_config() from the applescript module and returns combined status and configuration as a dict.
    @mcp.tool()
    def get_vm(name: str) -> dict:
        """Get status and configuration of a VM by name."""
        status = utm.get_vm_status(name)
        config = utm.get_vm_config(name)
        return {"status": status, **config.to_dict()}
  • The function signature defines the input schema: a 'name: str' parameter. The return type is 'dict' with keys 'status' and all VMConfig fields.
    def get_vm(name: str) -> dict:
        """Get status and configuration of a VM by name."""
        status = utm.get_vm_status(name)
        config = utm.get_vm_config(name)
        return {"status": status, **config.to_dict()}
  • Registered as an MCP tool via the @mcp.tool() decorator on line 22.
    @mcp.tool()
  • Helper function utm.get_vm_status(): queries UTM via AppleScript for the VM's status (stopped/started/paused).
    def get_vm_status(name: str) -> str:
        """Get the status of a VM by name."""
        _validate_vm_name(name)
        script = f'''
        tell application "UTM"
            set vm to virtual machine named "{_esc(name)}"
            return status of vm as text
        end tell
        '''
        return _run(script)
  • Helper function utm.get_vm_config(): queries UTM via AppleScript for the VM's configuration (name, memory, cpu_cores, mac_address, network_mode) and returns a VMConfig dataclass.
    def get_vm_config(name: str) -> VMConfig:
        """Read configuration of a VM."""
        _validate_vm_name(name)
        script = f'''
        tell application "UTM"
            set vm to virtual machine named "{_esc(name)}"
            set conf to configuration of vm
            set vmName to name of conf
            set vmMem to memory of conf
            set vmCores to cpu cores of conf
            set nics to network interfaces of conf
            if (count of nics) > 0 then
                set nic to item 1 of nics
                set macAddr to address of nic
                set netMode to mode of nic as text
            else
                set macAddr to ""
                set netMode to ""
            end if
            return vmName & "||" & vmMem & "||" & vmCores & "||" & macAddr & "||" & netMode
        end tell
        '''
        raw = _run(script)
        parts = raw.split("||")
        return VMConfig(
            name=parts[0] if len(parts) > 0 else "",
            memory=_parse_int(parts[1]) if len(parts) > 1 else 0,
            cpu_cores=_parse_int(parts[2]) if len(parts) > 2 else 0,
            mac_address=parts[3] if len(parts) > 3 else "",
            network_mode=parts[4] if len(parts) > 4 else "",
        )
Behavior3/5

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

Implies a read-only operation ('Get'), which is consistent with the sibling context, but does not disclose any behavioral traits beyond that. No mention of permissions, side effects, or output specifics.

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?

Single sentence with no unnecessary words. Front-loaded with the purpose. Every word earns its place.

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?

Lacks completeness: does not explain what 'status and configuration' includes (e.g., power state, hardware details). No output schema, so description should provide more context. Minimal for a read operation.

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?

Adds meaning by stating 'by name', which explains that the 'name' parameter identifies the VM. Without this, the schema only has a title 'Name'. Schema coverage is 0%, so description 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 'Get status and configuration of a VM by name', using a specific verb ('Get') and resource ('VM'), and distinguishes from siblings like get_serial_port or get_vm_ip.

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 vs alternatives (e.g., list_vms) or when not to use it. Only identifies the parameter 'by name' but no context on 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