Skip to main content
Glama

compose_logs

Read-only

Retrieve a bounded slice of logs from a Docker Compose project. Filters by service, tail lines, time range, and timestamps, returning promptly without following.

Instructions

Fetch a bounded slice of logs from a compose project (never follows).

Bounded and non-following by design, so it always returns promptly. For one container's logs use container_logs; for a swarm service use service_logs. Log text arrives on stdout. 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: 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 services: Restrict to these services (default: all) tail: Lines per container, or the literal "all" (still capped at MAX_CLI_OUTPUT_BYTES) since: Show logs since this timestamp/duration (e.g. "10m", "2024-01-01T00:00:00") until: Show logs before this timestamp/duration timestamps: Include per-line timestamps

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tailNo
filesNo
sinceNo
untilNo
servicesNo
timestampsNo
project_dirNo
project_nameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.0.0
    • addedInput schema / properties / tail / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "const": "all",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / tail / type
      Removed value: -"integer"
  2. First observedv1.9.0

TDQS

A5/5.0
Behavior5/5

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

Beyond the readOnlyHint/destructiveHint annotations, the description discloses non-following behavior, promptness, that log text goes to stdout, that a non-zero CLI exit does not raise but must be inspected via returncode/stderr, and that missing plugin or timeout still raises. It also notes project_dir is copied to target host if no local plugin. This is rich behavioral context well beyond annotation hints.

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 well-structured: a brief front-loaded behavioral statement, a clearly separated Args list, and a Returns section. Every sentence adds value—no filler. The Arg explanations are concise but complete, with inline examples where needed. The format is scannable and appropriately sized for an 8-parameter tool.

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?

Given the tool has no output schema, the description provides the return format (dict with returncode/stdout/stderr/truncated). It covers error behavior (non-zero CLI exit, missing plugin, timeout), parameter semantics, and usage alternatives. There is no obvious missing information an agent would need to call this 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?

Schema description coverage is 0%, so the description carries the full burden. It explains every parameter in the Args section: default behavior for project_dir, repeatable -f for files, override for project_name, restriction semantics for services, tail with 'all' and MAX_CLI_OUTPUT_BYTES cap, since/until with examples, and timestamps flag. This compensates fully 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?

The description opens with a precise action and resource: 'Fetch a bounded slice of logs from a compose project' and immediately disambiguates from siblings by naming container_logs and service_logs as alternatives. It also states a key scoping trait (never follows), making the tool's purpose unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly tells the agent when to use this tool versus siblings: 'For one container's logs use container_logs; for a swarm service use service_logs.' It also clarifies behavior that affects when it is appropriate (bounded, non-following, always returns promptly), giving the agent clear decision criteria.

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