Skip to main content
Glama

service_logs

Read-only

Retrieve a bounded snapshot of Docker Swarm service logs aggregated across all tasks. Control volume with tail, since, or max_bytes to prevent context overflow.

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 discloses key behavioral traits: never follows (avoids blocking), joins the stream into one string, caps at max_bytes with a ValueError, and aggregates across all tasks. These details are not present in annotations and are essential for safe invocation.

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 moderately long but every sentence contributes value. It front-loads the core purpose and then details caveats and parameter semantics in a structured list. Slight verbosity in the caveat paragraphs could be trimmed, but the structure is clear and effective.

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 tool's complexity (8 parameters, output schema, safety concerns), the description is remarkably complete. It covers edge cases like unbounded output, OOM risks, and the difference from container_logs. The return type is specified as 'str - Decoded log output', making it self-sufficient.

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 schema has 0% description coverage, but the description includes an args section that explains every parameter's meaning, defaults, and special values. For example, tail explains the default 200 and the literal 'all', max_bytes explains the ValueError abort, and since is defined as a Unix timestamp. This fully compensates 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 opens with a specific verb+resource+scope: 'Get a bounded snapshot of a swarm service's logs (never follows)'. This clearly states what the tool does and its non-following behavior. It also distinguishes itself from siblings by mentioning 'container_logs reads a single container', providing clear differentiation.

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?

Explicit usage guidance is provided: it warns against using 'tail="all"' due to context overflow, recommends using an integer or 'since' to constrain output, and contrasts with 'container_logs' for single-container logs. It also explains why 'follow' is not exposed. This goes well beyond implied usage.

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