Skip to main content
Glama

vm_exec

Executes commands inside a UTM guest virtual machine and returns exit code, stdout, and stderr, with an optional timeout for programs that keep running.

Instructions

Runs a program in the guest and returns exit_code, stdout and stderr. argv[0] is the executable (full path or on PATH), e.g. ["cmd.exe", "/c", "dir C:\"] or ["/bin/sh", "-c", "uname -a"]. Runs as the guest agent's user (SYSTEM on Windows, root on Linux) without a desktop, so GUI programs started here are invisible. If it outlives timeout seconds it keeps running and timed_out is true.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "vm": "<vm>",
      "argv": "<argv>"
    },
    "name": "vm_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
vmYes
argvYes
timeoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does well: it discloses the execution identity (SYSTEM on Windows, root on Linux), the absence of a desktop session, and the fact that exceeding timeout does not kill the process but sets timed_out. It omits whether output is truncated, what encoding is used, and whether the call blocks until completion.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core behavior is front-loaded in the first sentence, followed by parameter guidance and then the timeout caveat. Dense but not padded; the only slight inefficiency is that the GUI-invisibility note could be folded into the privilege sentence.

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?

There is no output schema, but the description enumerates the returned fields (exit_code, stdout, stderr, timed_out) and explains the non-obvious asynchronous timeout behavior. Given three simple parameters and no annotations, the only meaningful gap left is how the vm argument is identified.

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?

Schema description coverage is 0%, so the description must compensate, and it does for argv (argv[0] is the executable, full path or on PATH) with two concrete examples, and for timeout semantics. The required vm parameter is never explained (presumably an identifier from vm_list), and timeout's units and default are left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Runs a program in the guest and returns exit_code, stdout and stderr" states a specific verb, resource, and return shape, and the parenthetical about running as SYSTEM/root implicitly separates it from vm_run_user. It stops short of naming any alternative explicitly, so an agent must infer the boundary.

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 supplies worked examples of argv construction and warns that GUI programs launched this way are invisible, which implies when the tool is and isn't appropriate. It never states when to prefer a sibling such as vm_run_user, vm_job_start, or vm_ps, nor any prerequisite like the guest agent being installed or the VM being started.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.