Skip to main content
Glama

stack_ps

Read-only

List tasks in a Docker stack with their node, state, and error to identify where tasks run and why they failed.

Instructions

List the tasks of a stack, parsed from --format '{{json .}}'.

Task-level view across every service in the stack (service_ps covers one service): where each task runs and why it failed. Requires a swarm manager. Raises RemoteFailureError if the CLI call fails.

Args: name: The stack to list tasks for no_trunc: Do not truncate task IDs / errors in the output filters: Filter by attributes, e.g. {"desired-state": "running"}; a list value repeats the filter

Returns: list: One dict per task (id, name, node, image, desired/current state, error)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
filtersNo
no_truncNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv2.0.0
    • removedInput schema / properties / filters / items
      Removed value: -{
      -  "type": "string"
      -}
    • changedInput schema / properties / filters / type
      Previous value: -"array"New value: +"object"
    • addedInput schema / properties / name
      Added value: +{
      +  "type": "string"
      +}
    • removedInput schema / properties / stack_name
      Removed value: -{
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "stack_name"
      -]New value: +[
      +  "name"
      +]
  2. First observedv1.9.0

TDQS

A5/5.0
Behavior5/5

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

Annotations already indicate readOnlyHint and non-destructive. The description adds value beyond annotations: it discloses the failure mode ('Raises RemoteFailureError if the CLI call fails'), the underlying CLI format (`--format '{{json .}}'`), and the manager requirement. These are behavioral traits not captured by structured fields.

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 tightly written, leading with the core action, then providing a brief comparison, and end with an Args/Returns section that maps cleanly to the schema. No redundant or vague phrasing.

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?

For a read-only stack-task tool, it covers the action, the alternative, the prerequisite, the failure exception, and the return structure (list of dicts with specific fields). With no output schema, the description fully explains what the agent will receive. This is complete.

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 zero descriptions (coverage 0%), so the description must fully explain parameters. It does so: 'name' is defined as 'The stack to list tasks for', 'no_trunc' explains truncation behavior, and 'filters' includes a concrete example with the list-repeat semantics. All three parameters are meaningfully described.

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 states a specific verb+resource: 'List the tasks of a stack'. It also explicitly distinguishes from the sibling `service_ps`, noting this covers every service in the stack versus one. The purpose is unambiguous and differentiated.

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?

It names the alternative tool (`service_ps` covers one service) and gives the exact condition to choose this one ('Task-level view across every service in the stack'). It also states a prerequisite ('Requires a swarm manager'), giving clear context for when to use it.

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