Skip to main content
Glama

service_logs

Read-only

Retrieve a bounded snapshot of a Docker swarm service's logs, preventing blocking and memory overflow by capping output size.

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.

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?

Annotations already declare readOnlyHint=true and destructiveHint=false. The description adds crucial behavioral details: the stream is joined into a single string, collection is capped at `max_bytes` with a ValueError if exceeded, default `tail=200`, and the risk of `tail='all'` exceeding context. No contradictions.

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: a one-line summary, a narrative block explaining the 'never follows' design, then an args list. Information is front-loaded. However, the default `tail=200` is mentioned both in the narrative and the args list, which is slightly redundant. Overall, it is appropriately sized for the complexity.

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 8 parameters, annotations, and the presence of an output schema (returning str), the description covers all essential aspects: tool behavior, parameter details, return type, and risk mitigation (max_bytes, tail defaults). It is fully complete 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?

The input schema has 0% description coverage, so the description carries full burden for parameter meaning. It provides a detailed bullet list explaining each parameter (e.g., `since` as Unix timestamp, `max_bytes` aborting with ValueError, `tail` accepting integer or 'all'). This adds significant value beyond the schema's type and default annotations.

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 starts with 'Get a bounded snapshot of a swarm service's logs (never follows).' This uses clear verb+resource and immediately distinguishes this tool from log-following tools like compose_logs or container_logs, which may support streaming. The bounded snapshot concept sets it apart.

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 that `follow` is intentionally not exposed and why (blocks forever), and provides guidance on default `tail=200` and `max_bytes` to prevent issues. It implies when to use (bounded logs) but does not explicitly contrast with sibling log tools like compose_logs or container_logs, missing a clear when-not-to-use statement.

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