Skip to main content
Glama

service_logs

Read-only

Retrieve a bounded snapshot of a Docker swarm service's logs, aggregated across all tasks. Avoids blocking or unbounded output with configurable tail and byte limits.

Instructions

Get a bounded snapshot of a swarm service's logs (never follows).

follow is intentionally not exposed: the stream is joined into one string before returning, so following would block forever and grow unbounded. Collection is capped at max_bytes (ValueError if exceeded) so a noisy service can't OOM the server. The default is a bounded tail=200; tail="all" returns the whole buffer, which can be huge on long-running services and exceed the agent's context — prefer an integer, or since, to constrain output. Logs aggregate across all the service's tasks — container_logs reads a single container, and the service-logs://{id_or_name} resource is the resource-flavored equivalent of this tool.

args: id_or_name - The service id or name details - Show extra details stdout - Include stdout stderr - Include stderr since - Show logs since this Unix timestamp timestamps - Include timestamps tail - Number of lines from the end (default 200), or the literal "all" for everything max_bytes - Abort with ValueError if the buffered logs exceed this many bytes (default 32 MiB) returns: str - Decoded log output

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tailNo
sinceNo
stderrNo
stdoutNo
detailsNo
max_bytesNo
id_or_nameYes
timestampsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Beyond the readOnlyHint and destructiveHint annotations, the description reveals key behavioral traits: it never follows (stream joined into one string), caps collection at max_bytes and raises ValueError if exceeded, and warns that tail='all' can exceed agent context. This greatly exceeds the annotation-only info and helps prevent misuse.

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?

The description is front-loaded with a clear summary, followed by high-value caveats and a parameter list. Every sentence adds critical information (following behavior, memory safety, context limits, alternatives) with no fluff or repetition of annotations.

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?

Despite having 8 parameters and an output schema, the description covers all operational aspects: the blocking caveat, default bounds, error behavior, and the distinction from similar tools. The 'returns: str' line, combined with the output schema, leaves no material gaps for an agent to invoke 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 description coverage is 0%, but the description fully compensates by listing all 8 parameters with meaningful explanations. It clarifies the 'tail' default and literal 'all', max_bytes abort behavior, and the purpose of each flag, adding value far beyond the raw schema types.

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 opening line 'Get a bounded snapshot of a swarm service's logs (never follows)' uses a specific verb, resource, and scope. It clearly distinguishes from siblings by explicitly contrasting with container_logs and the service-logs://resource, making its purpose unambiguous.

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?

The description provides explicit guidance on when to use this tool and when to prefer alternatives: 'container_logs reads a single container' and the service-logs resource is the equivalent. It also warns against using tail='all' for long-running services and recommends preferring an integer or `since` to constrain output, offering actionable usage criteria.

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/L337-org/docker-mcp'

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