Skip to main content
Glama

compose_run

Run a one-off command in a new Docker Compose service container, returning output and exit code. Starts a fresh container instead of using an existing one for isolated tasks.

Instructions

Run a one-off command against a compose service.

Always passes -T (no TTY under MCP). Defaults to detached with --rm so the call returns promptly. Unlike compose_exec, this starts a NEW container for the service rather than running inside the existing one. Does not raise on a non-zero CLI exit (a missing compose plugin or a timeout still raises) - inspect returncode/stderr in the result.

Args: service: Service name from the compose file command: Command + args to run (exec-form; no shell unless you invoke one) 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 detach: Run detached rm: Remove the container after the run no_deps: Don't start linked services workdir: Working directory inside the container user: User to run as inside the container (uid or name) env: Environment variables to set inside the container name: Container name timeout_seconds: Subprocess timeout (default 600s)

Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rmNo
envNo
nameNo
userNo
filesNo
detachNo
commandNo
no_depsNo
serviceYes
workdirNo
project_dirNo
project_nameNo
timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.9.0

TDQS

A4.8/5.0
Behavior5/5

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

The description discloses behavior not visible in annotations: it forces -T, defaults to detached with --rm, creates a new container, and does not raise on non-zero exits (only plugin/timeout failures raise). This gives an agent accurate expectations for result handling and side effects.

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 dense but well-structured: two behavior paragraphs, a compact Args list, and a Returns line. There is no redundant content or filler, and the most important runtime caveats are front-loaded.

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?

For a tool with 13 parameters, no output schema, and several runtime caveats, the description covers invocation, defaults, error behavior, and return structure. The only minor omission is explaining the `truncated` flag semantics, but this is not needed to call the tool correctly.

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 Args block compensates by explaining every parameter, including non-obvious semantics: command is exec-form without a shell, project_dir is copied to target host if no local plugin, and timeout_seconds defaults to 600. This materially exceeds the bare schema.

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?

Opens with 'Run a one-off command against a compose service,' naming a specific verb, resource, and scope. It then distinguishes itself from compose_exec ('starts a NEW container rather than running inside the existing one'), making the tool 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?

The description gives a clear differentiation from compose_exec, one of the most likely alternatives, and gives concrete runtime conditions ('Always passes -T', 'Defaults to detached with --rm'). It doesn't enumerate every alternative compose subcommand, but the one-off framing plus the explicit contrast is sufficient guidance.

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

Deploy Server

Other Tools