Skip to main content
Glama

Get Docker Container Logs

docker_container_logs
Read-onlyIdempotent

Read recent log lines from an Unraid Docker container, with optional tail limit and timestamp-based paging, plus an automatic SSH fallback for containers that log only to stderr.

Instructions

Read-only. Returns the most recent log lines for a container. To page, re-pass the returned cursor as since; the boundary line repeats, so de-dupe. The API can miss containers that log only to stderr; when SSH is configured, this tool automatically falls back to docker logs for those (plain text in both formats). For the Unraid server's own log files use log_read instead.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>"
    },
    "name": "docker_container_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesContainer id from docker_container_list.
tailNoNumber of most recent log lines to return.
sinceNoInclusive lower bound as an ISO-8601 timestamp; pass a previous response's `cursor` to page forward.
response_formatNo`detailed` returns full JSON instead of readable text.concise

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.3
    • addedInput schema / properties / id / description
      Added value: +"Container id from docker_container_list."
    • addedInput schema / properties / response_format / description
      Added value: +"`detailed` returns full JSON instead of readable text."
    • addedInput schema / properties / since / description
      Added value: +"Inclusive lower bound as an ISO-8601 timestamp; pass a previous response's `cursor` to page forward."
    • addedInput schema / properties / tail / description
      Added value: +"Number of most recent log lines to return."
  2. First observedv0.1.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, destructiveHint=false), and the description adds genuinely non-obvious behavior beyond that: the paging convention using a returned cursor, the duplicated boundary line requiring de-duplication, and the API's tendency to miss stderr-only containers with an automatic `docker logs` fallback when SSH is configured. These are exactly the operational quirks an agent cannot infer from structured fields.

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?

Purpose is front-loaded after the one-word safety marker, followed by paging mechanics, the stderr caveat, and the sibling routing. Every sentence carries distinct information; nothing is padded or restated from the schema.

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?

There is no output schema, and the description compensates by describing what comes back (log lines plus a cursor, plain text, repeating boundary line). For a four-parameter read tool with full annotation coverage, nothing an agent needs in order to call this correctly is missing.

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 the baseline is 3. The description goes further by documenting the `cursor` value in the response that is passed back into `since` — a return-field semantic absent from the schema and from any output schema — and by noting output is plain text in both fallback and normal formats, which ties to `response_format`.

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 ('Returns the most recent log lines for a container') and immediately contrasts with the sibling log_read for the Unraid server's own logs. An agent can distinguish this from log_read and docker_container_list without opening any schema.

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 the agent away to log_read when the target is server log files rather than container logs. It also gives the paging procedure (re-pass the returned `cursor` as `since`) and names the condition under which the SSH fallback kicks in, so the agent knows both when to use it and how to iterate with it.

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