Skip to main content
Glama

OpenFactory

guest_command

Run commands and manage files on a VM via the QEMU guest agent.

This tool provides direct access to VMs without SSH — it uses the QEMU guest agent to execute commands, read/write files, and manage systemd services. The VM must be running and have the guest agent installed.

Use this for server administration, configuration, debugging, and automation tasks on VMs managed by OpenFactory.

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_name": "<vm_name>"
    },
    "name": "guest_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoPath for `file_read` or `file_write`.
typeNoPreferred structured action type. Supported values: `ping`, `exec`, `file_read`, `file_write`, `systemd_status`, `systemd_action`.
actionNoLegacy JSON action object. Preferred usage is the structured fields below (`type`, `command`, `script`, etc.). Supported types: {"type": "ping"} — Check if guest agent is available {"type": "exec", "command": "ls -la /tmp"} — Run a shell command (optional: "timeout": 60) {"type": "exec", "script": "#!/bin/bash\nset -e\nwhoami\npwd"} — Run a multiline bash script without client-side shell escaping {"type": "file_read", "path": "/etc/hostname"} — Read a file from the VM {"type": "file_write", "path": "/tmp/hello.txt", "content": "hello world"} — Write a file {"type": "systemd_status", "service": "sshd"} — Get service status {"type": "systemd_action", "service": "sshd", "action": "restart"} — Start/stop/restart/enable/disable a service Examples: {"type": "exec", "command": "df -h"} {"type": "file_write", "path": "/tmp/test.sh", "content": "#!/bin/bash\necho hello"} {"type": "systemd_status", "service": "nginx"}
scriptNoMultiline bash script for `type="exec"`. The server stages it in the guest and runs it, which avoids nested JSON and shell escaping.
api_keyNoYour OpenFactory MCP API key (optional)
commandNoShell command for `type="exec"`. Use `script` instead for multiline or complex shell work.
contentNoText content for `type="file_write"`.
serviceNoSystemd service name for `systemd_status` or `systemd_action`.
timeoutNoTimeout in seconds for `type="exec"` or the legacy JSON action.
vm_nameYesVM name or UUID to run the guest-agent command on. For a build goal this is the of-test-* VM that booted your image: use the vm_name returned by resume_test_environment, or vms[].vm_name / environment.snapshot.vm_name from get_test_results.
content_b64NoBase64-encoded file content for `type="file_write"`. Use this when you need exact bytes.
session_tokenNoSession token from a previous tool response
service_actionNoService action for `type="systemd_action"`: `start`, `stop`, `restart`, `enable`, `disable`, or `reload`.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose the important mechanic (no SSH, guest-agent transport) and the hard prerequisite of a running VM with the agent installed. However, it never warns that this tool mutates state (file_write, systemd_action start/stop/disable), whether writes overwrite or truncate existing files, or what privileges commands run under — significant omissions for a destructive-capable tool.

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 definition is four short sentences, front-loaded with the action and resource, and the prerequisites are grouped in one sentence. The middle sentence ('This tool provides direct access to VMs without SSH') slightly restates the opening but also adds the mechanism context, so waste is minimal.

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 13-parameter, multi-mode tool, the description covers the transport, the capability set (exec, file read/write, systemd), and the preconditions an agent needs before calling it, and an output schema exists so return values need not be explained. Gaps remain around privilege level, overwrite semantics, and timeout behavior beyond the schema's per-parameter note.

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 100% and every one of the 13 parameters has a documented meaning in the schema, so the baseline of 3 applies. The description body itself adds no parameter-level meaning beyond what the schema already states; the per-type examples live in the schema strings, not the description.

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?

The first sentence gives a concrete verb pair plus resource ('Run commands and manage files on a VM') and names the mechanism (QEMU guest agent), which lets an agent distinguish it from SSH- or API-based tools. It does not name any sibling tool as the alternative, so differentiation from other VM tools must be inferred from the mechanism description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives positive usage contexts ('server administration, configuration, debugging, and automation tasks on VMs managed by OpenFactory') and states the prerequisite conditions: the VM must be running and have the guest agent installed. It stops short of explicit exclusions or of naming which sibling to use for the same job when the guest agent is unavailable.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.