Skip to main content
Glama

compose_exec

Run a command inside an active Docker Compose service container, specifying environment, user, workdir, and timeout. Supports multi-replica services via index.

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; copied to the target host if no local plugin) 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?

The description reveals several non-obvious behaviors: it always passes `-T` (no TTY), the distinction between exec-form and `sh -c` in terms of shell interpretation, and the return dict structure with `truncated` flag. Since annotations only give readOnlyHint=false and destructiveHint=false, the description carries the full behavioral disclosure burden and does so thoroughly.

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?

The description is organized with a clear purpose sentence, behavioral notes, then a compact args list and return type. Every sentence provides unique value, and the length is justified given the tool's 10 parameters. No filler or redundant phrasing.

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?

This tool has 10 parameters, no output schema, and minimal annotations. The description compensates by explaining all parameters, return value, security considerations, and sibling differentiation. It gives an agent enough information to select, invoke, and interpret results correctly without needing external docs.

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?

The input schema has 0% description coverage, but the description enumerates all 10 parameters with concise explanations and defaults (e.g., 'index - Container index when the service has multiple replicas (default 1)' and 'project_dir - Dir with the compose file (default: server cwd; copied to the target host if no local plugin)'). This adds substantial meaning beyond the raw types and names.

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?

The description opens with 'Run a command inside an already-running compose service container', which clearly states the action, target, and scope. It distinguishes itself from the sibling `container_exec` by explicitly referencing it in parentheses, making the tool's niche unambiguous.

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?

It provides clear guidance: use `compose_exec` for compose service containers, references `container_exec` as an alternative, and instructs on the correct command format (exec-form argv) with a security warning about shell metacharacters. However, it does not explicitly state when NOT to use it or contrast all alternatives beyond the sibling mention, so it falls slightly short of a 5.

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