Skip to main content
Glama

swarm_task_inspect

Read-only

Inspect a single Docker Swarm task by ID or name to get its full configuration and status. Read-only, requires a swarm manager.

Instructions

Inspect a single swarm task, like docker inspect --type task.

For when you already hold a task reference -- from a swarm_task_list or service_ps row, a service event, or an error message -- and want just that task. swarm_task_list returns the same document for every task, so prefer it when scanning; this is the single-object fetch. To reach the container behind a running task, read Status.ContainerStatus.ContainerID and pass it to container_inspect / container_logs -- but note the container may be on another node, where those tools cannot see it, and service_logs aggregates across tasks instead; swarm_task_logs reads that one task's output wherever it landed. Read-only. Requires a swarm manager; reports the daemon's own error if the task does not exist, if a prefix matches more than one task, or if this node is not a manager.

Args: id_or_name: The task id, an unambiguous id prefix, or the task's full name -- which is the container-name form <service>.<slot>.<taskid> (<service>.<nodeid>.<taskid> for a global service), NOT the shorter <service>.<slot> that docker service ps prints in its NAME column, which does not resolve. The daemon tries full id, then full name, then prefix, and rejects an ambiguous prefix rather than picking a match

Returns: dict: Full task inspect payload, as docker inspect --type task. Carries no name field of its own; compose one from ServiceID/Slot if you need it

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
id_or_nameYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.2.5

TDQS

A5/5.0
Behavior5/5

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

Annotations already set readOnlyHint=true and destructiveHint=false, and the description reinforces this with 'Read-only'. It goes further by disclosing the daemon's resolution order (full id, full name, prefix), rejection of ambiguous prefixes, error raising for missing tasks or non-manager nodes, and the fact that the returned payload has no name field. This adds substantial behavioral context 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 dense but every sentence adds value: purpose, usage context, sibling alternatives, caveats, error behavior, parameter format, and return value are all covered without fluff. It is front-loaded with the core purpose and then branches into supporting details in a logical order.

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 single-parameter read-only tool with no output schema, the description is complete. It explains the return payload, how to derive a missing name field, how to reach the underlying container, and under what conditions sibling tools will fail. An agent has everything needed to decide when to invoke this tool and how to process its result.

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 provides only a bare string for id_or_name with 0% description coverage, so the description must fully compensate. It does, explaining that the argument can be an id, an unambiguous prefix, or a full name, with the exact name format, the pitfall of the shorter `docker service ps` name, and the daemon's matching behavior. This is thorough and actionable.

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 'Inspect a single swarm task, like docker inspect --type task', a specific verb and resource, and immediately contrasts itself with swarm_task_list by clarifying this is the single-object fetch. It also tells the agent exactly where a task reference can come from, making the purpose unambiguous.

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 explicitly states when to use this tool ('when you already hold a task reference ... and want just that task') and when not to ('prefer it when scanning' with swarm_task_list). It also provides clear routing to container_inspect, container_logs, service_logs, and swarm_task_logs, including caveats about node visibility. This is exemplary usage 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