Skip to main content
Glama

docker_exec

Runs one command inside a running container with a preview and confirmation step, optionally using shell, workdir, or user settings.

Instructions

Run one command inside a running container (no terminal, no input).

Destructive, because the command can do anything inside the container. Shows a preview first. Run again with confirm=true after the user says yes. By default the command is split like a shell would, but no shell is used (no pipes). Set shell=true to run it with sh -c (pipes, &&, redirects). workdir sets the folder inside the container. user sets the user.

Input Schema

NameRequiredDescriptionDefault
hostNo
userNo
shellNo
commandYes
confirmNo
workdirNo
containerYes

Output Schema

NameRequiredDescriptionDefault
resultYes

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?

With no annotations, the description carries the full load and does well: it discloses that the tool is destructive ('the command can do anything inside the container'), documents the two-phase preview/confirm gate, and explains that no shell is used by default so pipes and redirects fail unless shell=true. It omits failure behavior, timeouts, and output truncation, but the output schema covers return shape.

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?

Front-loaded with the core action, then one fact per line covering destructiveness, the confirm workflow, and shell semantics. Dense and largely waste-free; the mid-sentence line breaks ('but no shell is used / (no pipes)') slightly fragment the reading flow.

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 an arbitrary-command execution tool with an output schema present, the description covers the safety protocol and execution semantics well enough to call it correctly. The unaddressed 'host' parameter and absent error/timeout behavior are the remaining gaps.

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 coverage is 0%, so the description must compensate for seven undocumented parameters. It usefully explains shell, workdir, user, confirm, and how command is tokenized, but 'host' is never mentioned at all and 'container' is only implied by the first sentence — a meaningful gap given zero schema descriptions.

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 one command inside a running container', which implicitly separates it from docker_run/docker_create (new containers) and docker_cli. The parenthetical '(no terminal, no input)' sharpens the scope. It never names a sibling explicitly, so the differentiation is inferred rather than stated.

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?

Gives a concrete workflow: a preview is shown first, then call again with confirm=true after the user approves — this is exactly the sequencing an agent needs. It does not say when to prefer this over docker_cli or docker_run, so alternatives are left implicit.

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