Skip to main content
Glama

get_vm

Retrieve the current status and configuration details of a virtual machine by providing its name.

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'. Calls utm.get_vm_status() and utm.get_vm_config() and returns a combined dict with status and configuration.
    @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()}
  • Helper function get_vm_status() in applescript layer. Runs an AppleScript to get the VM's status by name.
    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 get_vm_config() in applescript layer. Runs an AppleScript to read the full VM configuration (name, memory, CPU, MAC, 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 "",
        )
  • Registration of 'get_vm' as an MCP tool via the @mcp.tool() decorator on the get_vm function.
    @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()}
  • Schema/interface of the 'get_vm' tool: accepts a string 'name' parameter and returns a dict with 'status' (string) plus all VMConfig fields (name, memory, cpu_cores, mac_address, network_mode).
    @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()}
Behavior3/5

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

With no annotations provided, the description carries full burden. It indicates a read operation but does not disclose whether authentication is needed, what exactly 'status and configuration' entails, or any potential side effects. Adequate but not explicit beyond the name.

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 of 8 words, directly conveying the action and resource. No unnecessary words or structure. Efficient and front-loaded.

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

Completeness4/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 is mostly complete. It explains what the tool does and how to specify the VM. Could elaborate on what configuration covers, but still adequate for this complexity level.

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?

Only one parameter 'name' exists with no schema description (0% coverage). The description adds 'by name', clarifying its purpose, but adds no format, constraints, or examples beyond what the schema already provides (string, required).

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'), resource ('VM'), and scope ('status and configuration'). This distinguishes it from sibling tools like list_vms (listing) and other getters like get_vm_ip (specific attribute).

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 implies usage for retrieving details of a single VM but provides no explicit guidance on when to use this tool versus alternatives (e.g., list_vms for all VMs, get_vm_ip for specific info). No when-not-to-use or context 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