Skip to main content
Glama

docker_logs

Read-only

Fetch the last lines of a Docker container's logs (50 by default) without streaming, so you can inspect recent container output on the local host or a configured remote server.

Instructions

Get logs from a Docker container: the last lines only, 50 by default, and it returns rather than following the stream

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

Input Schema

NameRequiredDescriptionDefault
nameYesContainer name to get logs from
linesNoNumber of log lines to return (default: 50)
serverNoRemote server name from config (optional, runs locally if omitted)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.41.0
    • changedInput schema / properties / lines / type
      Previous value: -"string"New value: +"integer"
  2. First observedv0.10.2

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered structurally. The description adds genuinely useful behavior — non-streaming, default of 50 lines — but says nothing about whether stderr is included, timestamps, or truncation behavior, which matters for log retrieval.

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?

A single compact sentence that front-loads the resource and tacks on the two qualifying behaviors. Efficient, though the double clause structure is slightly dense compared with a clean two-sentence split.

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 simple read-only tool with no output schema and fully documented parameters, the description covers what an agent needs: what it returns, how much, and that it doesn't block on a stream. Remaining gaps (stderr, timestamps) are minor against this complexity.

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 all three parameters (name, lines, server) are already documented in the schema. The description's mention of "50 by default" merely restates the schema default, adding no syntax or format detail beyond it — baseline 3.

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 ("Get logs from a Docker container") and immediately scopes it to last N lines rather than a stream, which separates it from siblings like docker_inspect and docker_stats without needing their schemas.

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 phrase "returns rather than following the stream" gives a clear usage condition and implicitly rules out a streaming-watch use case (which watch_check/watch_add cover). It stops short of naming an alternative tool explicitly, so it is not a full 5.

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