Skip to main content
Glama
falkenslab
by falkenslab

Run a command in a container

exec_in_container

Run commands in a running Docker container and return combined stdout/stderr with exit code, stopping after a timeout; confirm before changes.

Instructions

Run a command in a running container and return its exit code and output (stdout and stderr together), stopped after timeoutSeconds. The command is a list, one argument per item; for a shell line, use ["sh", "-c", "…"]. Can change the container: confirm with the person first unless it only reads.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNo
userNo
commandYes
workdirNo
containerYesThe container's name or id, as its list gives it
timeoutSecondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
outputYes
exitCodeYes
truncatedYesThe start was left out: it was longer than a model's context fits

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Adds real context beyond the annotations: output is stdout and stderr combined, an exit code is returned, execution is terminated after timeoutSeconds, and the command can mutate the container. The mutation warning plus the confirmation requirement go beyond what destructiveHint=false conveys. It does not mention auth/permission requirements or how env/user/workdir affect execution.

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?

Three tight sentences, front-loaded with purpose and return behavior, then the command-format detail, then the safety note. No filler. The middle sentence is somewhat dense but every clause carries information.

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 6-parameter tool an output schema already covers return values, and the description covers the critical invocation semantics (argv format, timeout) and the mutation caveat. The remaining gap is the meaning/effect of env, user, and workdir, which an agent would have to infer.

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 only 17%, so the schema documents just the container parameter. The description compensates for the highest-value gap by explaining that command is an argv list, one argument per item, with the ["sh","-c","…"] idiom for shell lines, and it touches timeoutSeconds. env, user, and workdir remain undocumented in both places, so compensation is partial.

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?

States a specific verb and resource: run a command in a *running* container, plus the return payload (exit code and combined stdout/stderr). This clearly separates it from create-and-run tooling like run_container. It does not, however, distinguish itself from the similar siblings compose_exec and lab_exec, so an agent must infer the scope difference.

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?

Provides a concrete usage rule: confirm with the person first because the command can change the container, unless it only reads. That is actionable when-to-use guidance tied to side effects. It stops short of naming alternatives (compose_exec for compose services, lab_exec for labs) or stating exclusions.

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