Skip to main content
Glama

compose_exec

Execute a command inside a running Docker Compose service container. Returns return code, stdout, stderr, and truncation status.

Instructions

Run a command inside an already-running compose service container (see also container_exec).

Always passes -T (no TTY). Pass an exec-form argv (e.g. ["python", "-V"]); a ["sh", "-c", "..."] form interprets shell metacharacters in untrusted substrings.

args: service - Service name from the compose file command - Argv to execute inside the container project_dir - Dir with the compose file (default: server cwd) files - Explicit compose file paths (repeatable, -f) project_name - Compose project name override index - Container index when the service has multiple replicas (default 1) workdir - Working directory inside the container user - User to run as inside the container (uid or name) env - Environment variables to set for the exec session timeout_seconds - Subprocess timeout (default 60s) returns: dict - {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNo
userNo
filesNo
indexNo
commandYes
serviceYes
workdirNo
project_dirNo
project_nameNo
timeout_secondsNo
Behavior5/5

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

Discloses important behavioral traits: always passes `-T` (no TTY), shell metacharacter handling, and return format. Annotations (readOnlyHint=false, destructiveHint=false) are consistent. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is appropriately sized, front-loaded with purpose, and logically structured: purpose, behavioral note, then parameter list. Every sentence adds value with no redundancy.

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?

Covers all parameters, return format, and key behavioral aspects. Slightly lacks explicit conditions like 'container must be running' or security implications of shell form, but overall complete for a high-complexity tool with no output schema or annotation support.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description provides thorough explanations for all 10 parameters, including defaults, formats (e.g., `command` as argv array), and the repeatable nature of `files`. This fully compensates for the lack of schema descriptions.

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?

Description clearly states 'Run a command inside an already-running compose service container', which is a specific verb and resource. It also contrasts with `container_exec`, distinguishing it as the compose-specific variant.

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 explicit alternative (`container_exec`) and explains command format differences (exec-form argv vs shell form). However, it does not explicitly state when not to use this tool (e.g., if container is not running) or when to prefer other tools like `compose_run`.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/L337-org/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server