Skip to main content
Glama

server_run

Execute shell commands directly on the Docker host with safety previews, confirmation for risky actions, sudo support, and background job handling.

Instructions

Run one shell command on the Docker host itself (not inside a container).

It starts in the stacks folder. Safe read-only commands (ls, cat, head, tail, grep, find, df, free, uptime, git status/log/diff, ps, ss, ip, and pipes between them) run right away. Anything else needs confirm=true after the user says yes. Risky ones (rm, mv, dd, chmod, chown, kill, systemctl, apt, reboot, sudo ...) are marked destructive in the preview. as_root=true runs it with sudo. Root commands always show a preview first. background=true starts it as a background job and returns a job id at once (use it for anything that can take more than about 40 seconds). Check it with server_job. Files with passwords or keys (.env, keys, credentials) are blocked. For files, prefer server_file_read, server_file_write and server_file_edit.

Input Schema

NameRequiredDescriptionDefault
hostNo
as_rootNo
commandYes
confirmNo
timeoutNo
backgroundNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does: it discloses the preview/destructive marking model, that root commands always preview first, that privileged operations require as_root with sudo, that credential files (.env, keys) are blocked, and that background runs return a job id immediately. These are exactly the behavioral traits an agent cannot infer from the schema.

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?

Long but front-loaded: the host-vs-container distinction is sentence one, and every subsequent sentence adds a distinct rule rather than restating the schema. It could be tightened slightly by grouping the safety-tier sentences, but there is little filler.

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?

An output schema exists, so return values need not be described, and the one return behavior that matters (background returns a job id) is called out. For a six-parameter, high-risk execution tool, the description covers permissions, confirmation, blocking rules, and async behavior.

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?

Schema coverage is 0%, so the description must compensate and mostly does: as_root, confirm, background, and command are all given semantics beyond their titles. However, the 'host' parameter and the 'timeout' parameter are never explained, leaving two of six parameters undocumented in both schema and prose.

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?

States a specific verb and resource ('Run one shell command') plus a precise scope boundary ('on the Docker host itself, not inside a container') that separates it from docker_exec and docker_cli. The starting directory is also given, so the agent knows exactly what is being invoked.

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

Usage Guidelines5/5

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

Explicitly sorts commands into auto-approved read-only sets and ones requiring confirm=true, and names server_job for checking background jobs plus server_file_read/write/edit as preferred alternatives for file work. The 'when to use background' rule (>~40s) is stated rather than left to inference.

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