Skip to main content
Glama

get_docker_container_logs

Retrieve a Docker container's stdout/stderr log lines read-only via the Docker API, optionally tailing lines and adding timestamps to debug or inspect container output.

Instructions

Returns a container's stdout/stderr log lines. Params: tail (line count) and timestamps. Read-only via the Docker API. Fatal if the daemon is unreachable or the container is unknown. Log content may contain sensitive data.

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": {
      "container_id": "<container_id>"
    },
    "name": "get_docker_container_logs"
  }
}

Input Schema

NameRequiredDescriptionDefault
tailNonumber of lines to tail (default: 100, max: 10000)
timestampsNoinclude timestamps (default: false)
container_idYescontainer name or ID

Output Schema

NameRequiredDescriptionDefault
logsYes
errorsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it declares the operation is read-only via the Docker API, names the two fatal failure modes (unreachable daemon, unknown container), and warns that log content may contain sensitive data. It stops short of covering truncation behavior when tail is exceeded or whether the call blocks on a live container.

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?

Four short sentences, front-loaded with the core purpose and followed by parameters, safety profile, and failure modes in a sensible order. The 'Params:' clause slightly duplicates the schema and could be dropped, but nothing else is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value shape need not be explained. For a 3-parameter read tool with no annotations, the description covers purpose, read-only nature, error conditions, and data sensitivity — enough to invoke it correctly, with only minor gaps around truncation and live-stream behavior.

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

Parameters3/5

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

Schema description coverage is 100%, so defaults, max, and semantics for tail, timestamps, and container_id are already fully documented in the schema. The description's 'tail (line count) and timestamps' merely restates those fields and adds no new meaning, making the baseline 3 appropriate.

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 a container's stdout/stderr log lines' — which is unmistakably distinct from sibling tools like get_docker_container_details, get_docker_container_stats, or get_journal_logs. An agent can pick this tool without opening the schema.

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

Usage Guidelines3/5

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

Usage is only implied: you call it when you want a container's logs. There is no explicit when-to-use framing, no exclusions, and no routing to alternatives such as get_journal_logs for host-level logs or get_docker_container_details for container metadata.

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