Skip to main content
Glama

docker_container_exec

Run commands inside a running Docker container with argv-based execution, optional environment variables, working directory, and timeout controls. Returns bounded output for inspection and automation.

Instructions

Execute a command in a running container (argv, no shell, bounded output)

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": {
      "container_id": "<container_id>",
      "command": "<command>"
    },
    "name": "docker_container_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNoExtra environment variables
commandYesCommand and arguments to run
workdirNoWorking directory inside the container
container_idYesContainer ID or name
timeout_secondsNoMaximum run time in seconds (1-300)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.14.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare openWorldHint=false, idempotentHint=false and destructiveHint=false, so safety signaling is supplied. The description adds two pieces of real behavioral context beyond that: commands are passed as argv with no shell interpretation, and output is bounded. It stops short of saying what happens on non-zero exit, how output is truncated, or whether the timeout kills the process; note also that arbitrary executed commands can in practice be destructive, which sits in mild tension with destructiveHint=false.

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?

A single front-loaded sentence with two tight parenthetical qualifiers; nothing is wasted. It is arguably too compressed given the operation's risk, but there is no filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Return values are covered by the output schema, and required inputs are documented, so the essentials are present. What is missing is failure semantics (non-zero exit codes, timeout behavior, truncation limits) that matter for an exec tool the agent cannot see the results of in advance.

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%, so every parameter (container_id, command, env, workdir, timeout_seconds) is already documented in the schema, including the 1-300 timeout range. The description adds no parameter-level meaning beyond that, so the baseline of 3 applies.

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 description names a specific verb and resource ('Execute a command in a running container') and scopes it to running containers. It does not name any sibling (e.g., docker_run_container for new containers, docker_fetch_container_logs for output retrieval), so differentiation is left to the agent's inference from sibling names.

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?

'In a running container' implies the precondition, but there is no explicit when-to-use/when-not or pointer to alternatives such as docker_run_container for starting a new process container or docker_container_processes for inspecting processes. Usage is implied rather than stated.

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