Skip to main content
Glama

container_logs

Read-only

Read the last N stdout and stderr log lines from a container to diagnose recent errors, failures, or restart causes.

Instructions

[READ] Tail the last N log lines of a container (stdout + stderr).

Args: container_id: Container id or name. tail: Number of lines from the end (1..2000, default 100). target: Target name from config; omit for the default.

Returns an envelope: {"lines": [...], "returned": N, "limit": L, "truncated": bool}. When "truncated" is true the container has older log history than was returned — re-run with a higher tail rather than treating this as the container's complete log.

Input Schema

NameRequiredDescriptionDefault
tailNo
targetNo
container_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so safety is covered. The description adds real behavioral value beyond that: the exact return envelope shape, what 'truncated' means, and the correct recovery action (raise tail rather than assume complete history). It doesn't mention pagination between re-runs, but the truncation contract is the key trait an agent needs.

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 [READ] tag and one-line purpose, then Args and Returns sections that each earn their place. Slightly list-like in the Args block, which repeats parameter names, but the added semantics justify it.

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, yet the description documents the return envelope and the truncation flag's meaning, plus the recovery action. Combined with fully documented parameters, an agent has everything needed to call and interpret this tool correctly.

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?

Schema coverage is 0%, so the description carries the full burden and does so: container_id (id or name), tail with its valid range 1..2000 and default 100, and target's meaning (config target name, omit for default). This fully compensates for the empty schema descriptions.

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 (tail), resource (container logs), and scope (stdout + stderr, last N lines). The [READ] marker and the log-specific framing make it clearly distinct from siblings like container_stats, inspect_container, and container_top.

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 context is implied (log inspection for troubleshooting) and the re-run guidance when truncated is helpful, but it never says when to prefer this over inspect_container or container_stats, nor when not to use it. No alternatives are named.

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