Skip to main content
Glama

container_logs

Read-only

Get container logs as a one-shot snapshot or bounded live tail, with options for line count, timestamps, and stream selection.

Instructions

Get the logs of a container: a one-shot snapshot by default, or a bounded live tail with follow=True.

Follow mode returns when limit_lines lines are collected, timeout_seconds elapses, or the container exits, whichever comes first — so the agent can watch live output without blocking forever. limit_lines/timeout_seconds apply only in follow mode; until only in snapshot mode.

Caveat for ssh:// daemons: docker-py can't cancel an SSH stream, so in follow mode the timeout_seconds watchdog can't interrupt a fully silent container — use the snapshot mode there if you need a hard time bound.

args: id_or_name - The container id or name stdout - Include stdout stderr - Include stderr timestamps - Include timestamps tail - Number of lines from the end (default 200), or the literal "all" for everything since - Only return logs created after this unix timestamp until - Only return logs created before this unix timestamp (snapshot mode only) follow - Follow the live log stream instead of returning a snapshot limit_lines - Follow mode: max lines to collect before returning (default 200) timeout_seconds - Follow mode: max wall-clock seconds before returning what was collected (default 30) returns: str - Decoded log output (up to limit_lines lines in follow mode)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tailNo
sinceNo
untilNo
followNo
stderrNo
stdoutNo
id_or_nameYes
timestampsNo
limit_linesNo
timeout_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations indicate readOnlyHint=true and destructiveHint=false, and the description aligns by describing log retrieval as a read operation. It adds behavioral details about follow mode termination conditions and SSH limitations.

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?

The description is well-structured with sections and front-loaded purpose, but it is slightly verbose. Each sentence adds value.

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 complexity (10 parameters, output schema present), the description covers all aspects: parameter details, return type, and behavioral nuances. No gaps.

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?

With 0% schema description coverage, the description provides a comprehensive list of all 10 parameters with explanations, fully compensating for the schema gap.

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 clearly states 'Get the logs of a container' and distinguishes between snapshot and follow modes. It differentiates from sibling tools like compose_logs and service_logs.

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 description explains when to use snapshot vs follow mode and includes a caveat for SSH daemons. It provides context for mode selection but doesn't explicitly state alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GavinLucas/docker-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server