Skip to main content
Glama

service_logs

Read-only

Retrieve a bounded snapshot of aggregated logs from a Docker swarm service, capped to avoid overwhelming context. Specify tail, since, or max_bytes to constrain output.

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 (ToolInputError 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: use swarm_task_logs for one task, container_logs for one container, and the service-logs://{id_or_name} resource for the resource-flavored equivalent of this tool.

Args: details: Show extra details since: Show logs since this Unix timestamp tail: Number of lines from the end, or the literal "all" for everything max_bytes: Abort with ToolInputError 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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.0.0
    • addedInput schema / properties / id_or_name
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / service_id
      Removed value: -{
      -  "type": "string"
      -}
    • changedInput schema / properties / tail / default
      Previous value: -"all"New value: +200
    • changedInput schema / required
      Previous value: -[
      -  "service_id"
      -]New value: +[
      +  "id_or_name"
      +]
  2. First observedv1.9.0

TDQS

A4.8/5.0
Behavior5/5

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

Even with readOnlyHint=true, the description adds substantial behavioral context: logs are joined into one string, following would block forever, collection is capped at max_bytes with a ToolInputError, and tail='all' can exceed the agent's context. This goes well beyond the annotations and directly informs 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.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core behavior and the most critical constraint. Every sentence carries useful information: the non-following caveat, the returned string shape, the max_bytes safeguard, the tail default and warning, the sibling-tool routing, and parameter summaries. There is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the key operational hazards, appropriate usage, alternatives, parameter basics, and return type. It is slightly incomplete because the stream selection parameters (stderr, stdout) and timestamps are not described, and id_or_name is only implied. Overall it is strong enough for safe invocation, but not exhaustive given the 0% schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema description coverage at 0%, the description compensates for the most important parameters: details, since, tail, and max_bytes, including the special meaning of tail='all' and the error behavior of max_bytes. However, it omits semantics for stderr, stdout, timestamps, and id_or_name, so the compensation is strong but not complete.

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 and resource: 'Get a bounded snapshot of a swarm service's logs (never follows).' It clearly distinguishes this tool from nearby siblings by stating that logs aggregate across all tasks and pointing to swarm_task_logs and container_logs for narrower scopes. This is not a vague or tautological purpose statement.

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?

Usage guidance is explicit and actionable. It warns against following, recommends preferring integer tail values or since over 'all' to avoid huge outputs, and names concrete alternatives for task-level, container-level, and resource-flavored log retrieval. This tells an agent exactly when to use this tool versus its siblings.

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

Deploy Server

Other Tools