Skip to main content
Glama

stack_services

Read-only

List all services in a Docker stack, showing ID, name, mode, replicas, image, and ports. Filter by attributes to pinpoint specific services, helping monitor stack health and resolve configuration issues quickly.

Instructions

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

Service-level rollup (replicas ready per service); use stack_ps for individual tasks and service_inspect for one service's full spec. Requires a swarm manager. Raises RemoteFailureError if the CLI call fails.

Args: name: The stack to list services for filters: Filter by attributes, e.g. {"name": "web"}; a list value repeats the filter

Returns: list: One dict per service (id, name, mode, replicas, image, ports)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
filtersNo

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

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds meaningful behavioral context: the tool parses CLI output from a specific format, performs a service-level rollup, requires a swarm manager, and raises RemoteFailureError on CLI failure. It does not describe pagination or rate limits, but for a read-only list tool this is strong disclosure beyond the annotations.

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 compact and front-loaded: the core action and parsing detail come first, followed by routing guidance, prerequisites, error behavior, and parameter docs. Every sentence earns its place; there is no filler or repetition of the schema.

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?

For a 2-parameter read-only tool with no output schema, the description covers the action, parsing source, rollup semantics, sibling routing, prerequisite, error behavior, and both parameters. The return shape is described ('One dict per service (id, name, mode, replicas, image, ports)'), which compensates for the missing output schema. The only minor omission is not detailing how filters combine or whether they are AND/OR, but that is a small gap.

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?

Schema description coverage is 0%, so the description must compensate. It does: 'name: The stack to list services for' and 'filters: Filter by attributes, e.g. {"name": "web"}; a list value repeats the filter.' This adds real meaning beyond the bare schema types, especially the list-value repetition behavior for filters. The only minor gap is not enumerating all possible filter attributes, but the example and repetition rule are sufficient for correct invocation.

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 ('List'), a resource ('services of a stack'), and a parsing detail ('from `--format '{{json .}}'`'). It also distinguishes itself from stack_ps and service_inspect, which are the closest siblings. An agent can tell exactly what this tool does and what it does not do.

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?

The description explicitly says when to use this tool ('Service-level rollup') and names the alternatives for other needs: 'use stack_ps for individual tasks and service_inspect for one service's full spec.' It also states a prerequisite ('Requires a swarm manager') and an error condition ('Raises RemoteFailureError if the CLI call fails'). This is complete routing guidance.

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