service_logs
Retrieve a bounded snapshot of a Docker swarm service's logs with optional filtering by tail count, timestamp, and source (stdout/stderr), capped to prevent 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.
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
| Name | Required | Description | Default |
|---|---|---|---|
| tail | No | ||
| since | No | ||
| stderr | No | ||
| stdout | No | ||
| details | No | ||
| max_bytes | No | ||
| id_or_name | Yes | ||
| timestamps | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |