Skip to main content
Glama

docker/logs

Read-onlyIdempotent

Read a container's recent stdout and stderr logs, interleaved, with optional time and line filters. Use for debugging container output without following.

Instructions

Reads one container's recent logs, the container counterpart of logs/journal-control: stdout and stderr interleaved in Docker's order, the last lines lines (default 100), never a follow. Read-only. since/until take a unix timestamp (1759005000) or an RFC3339 time; stdout and stderr default to true (both false returns nothing); timestamps prefixes each line. The answer is capped at 1 MiB and an oversized tail is cut at the END without a marker, so the newest lines can be lost: ask for fewer lines. Only containers in the grant's containers: list; always runs as root, refused unless the grant has allowed: true. Plain log text by default (Container X (ID) has no log output for this selection. when empty); output_format: json returns container, id, lines, logs. To run a command use docker/exec; for host logs logs/journal-control.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linesNoTail this many lines (default 100)
sinceNoOnly entries after this time: unix timestamp (e.g. 1759005000) or RFC3339
untilNoOnly entries before this time: unix timestamp or RFC3339
stderrNoInclude stderr (default true)
stdoutNoInclude stdout (default true)
containerYesContainer name, full ID or ID prefix
timestampsNoPrefix every line with Docker's own timestamp
output_formatNojson returns container, id, lines, logs; default is raw log text

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare the safe-read profile (readOnlyHint, idempotentHint, destructiveHint=false), yet the description adds substantial context beyond them: interleaved stdout/stderr ordering, never-follow semantics, a 1 MiB cap with the oversized tail silently cut at the END (so newest lines can be lost), the auth/grant refusal condition, and the empty-result message. This is the kind of operational detail that prevents silent surprises.

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?

Front-loaded with the core purpose and alternatives, and every clause carries information (defaults, truncation, auth, output shape). It is dense and semicolon-heavy, which slightly reduces scanability, but there is essentially no filler to cut.

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 an 8-parameter read tool with no output schema, the description covers everything an agent needs: return format (plain text vs `output_format: json` fields), empty-result behavior, auth/grant requirements, and the lossy truncation case. Nothing material is left to inference.

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

Parameters4/5

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

Schema coverage is 100%, so each parameter already carries its own description; the description still adds value by disclosing interaction and edge-case semantics, e.g. "stdout and stderr default to true (both false returns nothing)" and tying `lines` to the truncation cap. It reinforces rather than merely repeats the schema, though it does not add syntax detail beyond the timestamps example already in the 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?

States a specific verb and resource ("Reads one container's recent logs") and immediately anchors it against a named sibling ("the container counterpart of logs/journal-control"). The ordering, default line count, and no-follow constraint are all specified, so the agent knows exactly what this tool returns.

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?

Explicitly routes away to alternatives: "To run a command use docker/exec; for host logs logs/journal-control." It also states the preconditions that gate invocation ("Only containers in the grant's containers: list; always runs as root, refused unless the grant has allowed: true"), which is exactly the when/when-not guidance an agent needs.

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