MCP tools and resources
This page is the catalog an agent sees over Cetacean’s MCP server: 22 resources, 31 tools, 6 prompts, and 5 widgets. For enabling the server, authorization, and configuration, see MCP server.
Everything here is filtered per identity. A tool above the configured operations level isn’t registered at all; a tool or resource the identity holds no grant for is hidden from the listing and refused at call time.
Tools
Tools are gated by operations level (mcp.operations_level, inheriting server.operations_level)
and by per-resource write grants. Every MCP tool requires the same operations level as the API route for
the same operation, so there’s no MCP-specific scheme to learn.
Each tool advertises the behavioral hints (readOnlyHint, destructiveHint, idempotentHint,
openWorldHint) clients use to gate confirmation prompts and an output schema the server validates results
against. A mutating tool returns an error when someone else changed the resource first, so re-read it and retry.
Conditional writes
Every tool that edits an existing service or node takes an optional version, the MCP counterpart of the
API’s If-Match. Pass the version that describe returned, and the write is applied only if the resource
is still at that version. If it changed in between, the tool refuses with an error saying it changed since you
read it and naming the version it’s at now, and writes nothing: describe it again, check your change still
makes sense, and retry with the new version. Without version the write applies to whatever the resource holds
when it lands.
The result of a write carries the version it left the resource at, but Swarm also moves a version on its own
while it carries out a change: the rolling update that follows an image, restart, rollback, or task spec change,
or a node’s role change. After such a write, describe the resource again before the next conditional write.
Removals and creates take no version. Swarm checks a version only on an update, so a removal couldn’t be
refused atomically, and a create has no earlier state to compare against. No tool edits a config, secret, or
the swarm itself, so none of those take one either.
update_service_secrets, update_service_configs, and update_service_mounts check the attachment against
Cetacean’s copy of the service, so a version newer than that copy is refused until Cetacean catches up,
typically within a second. Retry it unchanged, and if it’s still refused, describe the service again.
Removals are irreversible: no spec history is retained after a service removal, and a config, secret, or volume payload can’t be recovered.
Orientation
Where to start, and how to turn a name into something you can act on. find and describe attach links to the
resources they returned, so a host can offer somewhere to go next.
get_cluster_status
Answers whether the cluster is healthy and, when it’s not, names the services not in their desired state or restarting in a loop, the nodes down or draining, the rollouts in flight, reserved against total CPU and memory, and how many managers are reachable and how many more failures quorum survives. Start here.
find
Locates resources. With type it enumerates that type, paged by offset and capped at the same 200 the default
sets. Without type it searches every type at once: offset is ignored, and the result carries counts, the
per-type breakdown behind total.
describe
Returns one resource as a Digest. id takes an ID or a name—a hostname for a node, the rendered
{service}.{slot} for a task, the plain name for everything else—and a name matching more than one
resource
is refused, naming the matching IDs.
get_topology
Projects the cluster as a graph: network joins services to the overlay networks they attach to, placement
joins nodes to the services they run, and drain-impact joins the services on one node to the nodes that could
take them.
In drain-impact a service with no edges is stranded, and its detail names the placement constraint that
blocked it; a global service reports as global, since draining stops its task rather than relocating it.
Constraints are evaluated the way Swarm enforces them; spare capacity isn’t considered, since
get_cluster_status already reports reserved against total. Where grants hid candidate
nodes, the graph carries
a note saying what the assessment was narrowed to.
Observation
What the cluster is doing now, and what it did recently.
get_logs
Fetches recent log lines from one scope.
A task reads one replica and is the only way to reach one that has already exited—the form to reach for after
a crash, and the most perishable, since Swarm discards a task’s output with the task record, five per replica
slot by default. A service in a restart loop may hold seconds of history, so read it first. stack and
cluster merge server-side and attribute each line to its service, so grepping the cluster with contains
costs one call; a wide read covers at most 25 services and reports what it couldn’t reach in errors rather
than failing.
get_events
The change timeline, newest first. resource takes a name as readily as an ID, resolved against types when
exactly one is given and otherwise only where no other type claims the name. A service’s timeline includes its
tasks’ entries unless types leaves out task, and a stack’s the changes to its services. A change made through
Cetacean carries an actor naming who made it, as the history does.
Annotations appear as entries of kind annotation, with their text, tags, the
resources they name, and the id and version the annotation tools take, at the time they describe. One is
listed with the changes of the resources it names, a service’s with those on its stack, a stack’s with those on
its services, and a cluster-wide one with every resource’s. Only the annotations the caller may read are returned.
A gap with recoveredFrom had changes recovered from Docker’s event log: entries marked
recovered sit inside it, complete from recoveredFrom for every type but tasks.
kinds keeps entries of the kinds given: change, gap, or annotation. tags keeps the annotations carrying
every tag given, or any of them with matchAny. authors keeps what an actor with one of the subjects given did:
the annotations they wrote and the changes they made through Cetacean. search keeps the entries showing each
of its words, as the history’s search does. Gaps pass tags, authors and search.
get_metrics
Charts or ranks CPU, memory, or network use. It takes a target and a metric rather than PromQL, resolves the service or node against Cetacean’s cache, and checks the caller’s read grant before querying.
Asking for top turns it into a ranking: target: "cluster" ranks the busiest services, or nodes with
by: "node", and target: "node" with an id ranks the services on that host, which answers why a node is
hot.
Metrics need Prometheus, plus cAdvisor for service metrics and node-exporter for node metrics; without them the tool says metrics are unavailable rather than returning empty series.
get_published_ports
Every port the services publish, by port, with the service and stack behind it. An ingress port is bound on every
node; a host-mode port names the IDs of the nodes binding it that the caller may read. Answers which service owns
a port, or whether one is free.
Only ports of services the caller may read are listed, as on GET /ports.
get_recommendations
The recommendation engine’s current findings, the same ones cetacean://recommendations
returns, with totals counting what the caller may read. A finding with a remedy carries it as fix, naming the
tool to call, for example {"tool": "update_service", "section": "resources"}. A finding whose REST fixAction
route has no MCP tool behind it reports no fix.
watch
Blocks until a service has settled, then reports whether it did. It exposes the same convergence rule the converging mutations use, as a read; the wait can’t be canceled once started.
Service lifecycle
Running services: how many replicas, which image, and starting over. All four converging tools accept task augmentation and return a summary of where the service ended up rather than its full spec:
{
"id": "web",
"name": "web",
"image": "nginx:1.27",
"mode": "replicated",
"replicas": 5,
"running": 5,
"state": "running",
"version": 42
}
running is the live count, state is the same derivation the dashboard and the API report,
and version is the Swarm version index the write left the service at (see conditional
writes for when it moves on by itself). replicas is omitted for a global service.
scale_service
Sets the desired replica count. 0 stops every task without removing the service.
update_service_image
Sets the container image, triggering a rolling deploy per the service’s update policy. On a service with host access—a bind, named-pipe, or cluster mount, a volume with driver options, or an added capability—it needs level 3.
rollback_service
Reverts to the previous spec. Only one previous spec is retained, so calling twice doesn’t unwind further. On a service with host access in either spec it needs level 3, so it can’t restore a bind a level-3 caller removed.
restart_service
Forces a rolling restart by bumping ForceUpdate. No other spec field changes.
remove_task
Deletes a task; Swarm reschedules a replacement, so this is a forced reschedule.
remove_service
Deletes a service and stops every task. Doesn’t delete the volumes, networks, configs, or secrets it referenced.
Service configuration
Editing a service’s spec. These tools return the section they changed rather than the whole service:
{
"id": "web",
"name": "web",
"version": 42,
"section": "resources",
"details": {
"cpuLimitCores": 2,
"memoryLimitBytes": 1073741824
}
}
details reports the edited section as describe would, naming environment variables and log driver options
without their values—so raising a CPU limit never hands back the service’s credentials.
update_service_secrets, update_service_configs, and update_service_mounts replace their set wholesale:
pass every entry the service should end up with, because one left out is detached—and a container may lose
data it was writing to a dropped mount. An empty array clears the set; a missing or null list is refused rather
than read as empty.
update_service
Changes one section of a service’s spec. section takes one of ten names, and value that section’s new value:
| Section | Value | Semantics |
|---|---|---|
env | Merge-patch object | A string sets a key, null deletes it, an omitted key is preserved |
labels | Merge-patch object | Same as env; the only service section that doesn’t trigger a rolling deploy, along with the two policies |
resources | ResourceRequirements | CPU and memory limits and reservations |
placement | Placement | Constraints, preferences, max replicas per node, platforms; may reschedule tasks |
ports | Array of PortConfig | Drops connections to any port it removes or remaps |
update-policy | UpdateConfig | Applies to the next spec change |
rollback-policy | UpdateConfig | Applies to rollback_service |
log-driver | Driver | Name plus options; routes subsequent log lines |
healthcheck | Probe | test as an array (["CMD-SHELL", "curl -f localhost || exit 1"]), plus interval, timeout, startPeriod, retries. Durations are strings such as "10s". An empty test removes the check |
command | command plus args | The entrypoint and what follows it, the split Docker makes. Omitting one clears it |
Every section other than env and labels replaces its section wholesale: a field you omit is cleared.
On a service with host access, a placement, env, labels, ports, command, or healthcheck value
that changes the section needs level 3, as update_service_image does; so do update_service_secrets,
update_service_configs, and update_service_mounts when they change the set attached.
A null value is refused for every section.
Secrets, configs, and mounts aren’t sections here. Each takes a list rather than a spec fragment, and
attaching a secret checks a read grant on the secret as well as a write grant on the service, so each is a tool
of its own. Passing one as a section is refused with the name of the tool to use.
update_service_secrets
Replaces the complete set of secrets a service receives.
update_service_configs
Replaces the complete set of configs a service receives.
update_service_mounts
Replaces the complete set of mounts: named volumes, host bind mounts, tmpfs.
A bind mount hands the container the host’s filesystem at that path, and binding /var/run/docker.sock gives
it control of the whole cluster, and a volume with driver options can bind the host too. Below level 3 a bind
mount the service doesn’t already have is refused, and so is a named volume the manager doesn’t hold as a plain
local volume; at level 3, update_service_mounts does it if asked.
The tool can’t set bind options, so a bind the service has with a propagation mode reads as changed: below level 3 it’s refused, and at level 3 resending it drops the mode.
Cluster resources
Configs, secrets, networks, and volumes. Swarm secrets and configs are immutable, so rotating one is three
calls in order: create_secret for the replacement, labeled cetacean.version-of=<logical name> and with the old
version’s com.docker.stack.namespace label so it groups with the versions it replaces, update_service_secrets to
repoint each service that uses it (describe the secret first: its related array names them as used-by, and a service only a rollback needs as used-by-rollback, which stays), then
remove_secret once no used-by service is left. Configs follow the same sequence, and unlike a secret a config’s
content can be read back, so use a secret for anything sensitive.
create_secret
Creates a Swarm secret. From a client that supports URL elicitation, leave out data: you’re sent to the
dashboard to enter the value, so it never passes through the conversation, and passing data is refused. Other
clients pass data, unless mcp.inline_secret_values is off.
create_config
Creates a Swarm config.
remove_secret
Deletes a secret. Fails while a service’s current spec references it; one only a previous spec names is removed, and the confirmation names the rollbacks it breaks.
remove_config
Deletes a config. Fails while a service’s current spec references it; one only a previous spec names is removed, and the confirmation names the rollbacks it breaks.
remove_network
Deletes an overlay network. Fails if a service is attached; ingress and docker_gwbridge can’t be removed.
remove_volume
Deletes a volume by name. Fails if a container is using a local volume, even with force, which there only
overrides an error from the volume driver. On a cluster volume, force deletes it even while it is in use.
Nodes
Where work is allowed to run, and who votes in Raft.
update_node_labels
Patches a node’s labels (JSON Merge Patch).
update_node
Changes a node’s availability or role.
Draining a manager may destabilize the swarm, so prefer draining workers. Promoting a node adds a Raft voter
and demoting removes one: never reduce the manager count below the quorum threshold, and on a three-manager
cluster demote at most one at a time. Node labels stay a tool of their own,
update_node_labels, at level 2, so a deployment that lets an agent relabel a node doesn’t also let it demote a manager.
Annotations
Notes on the timeline that people and agents read back later.
add_annotation
Records an annotation about a moment, or a range ending at until: a load test, a deploy,
what an incident turned out to be. resources names the services, stacks, and nodes it’s about as objects
with a type and an id, which takes a name as readily as an ID; without any it’s cluster-wide. It needs
write on every resource it names, or on everything for a cluster-wide one, and storage.timeline.
An annotation changes nothing in the cluster, so the annotation tools are registered at every level, and none is
registered with storage.timeline off. It’s attributed to the caller via MCP. The result carries the id and
version the next two tools take.
update_annotation
Changes the arguments given and leaves the rest. An empty until makes the note a moment, and tags and
resources replace the current ones, so an empty list clears them; no resources makes the note cluster-wide. The
author may edit a note while they can still read it, and anyone else needs what creating it would; a new
resources needs that for the new set too. With version, the edit applies only if nobody has written the note
since, and is otherwise refused with the current version. The editor is recorded beside the author.
delete_annotation
Removes the note for everyone, under the same rule as an edit, and as conditionally with version.
Resources
Resources are read-only views returned as application/json. Four are static, eighteen are URI templates.
cetacean://cluster- Node, service, task, and stack counts, node readiness, task counts by state, total and reserved CPU and memory, the largest node’s capacity, converged and degraded service counts, manager quorum, last sync time
cetacean://recommendations- Current recommendation engine findings, each with severity, category, target resource, and rationale
cetacean://history- The most recent create, update, and delete events across every resource type, newest first, up to 100. A task event is named after its service (
demo_flaky.3) rather than by task ID;resourceIdstill carries the ID cetacean://annotations/tags- The tags on the annotations the caller may read, each with how many carry it, most used first
Every numeric field in cetacean://cluster names its unit: totalCPUCores, reservedCPUCores,
maxNodeCPUCores, totalMemoryBytes, reservedMemoryBytes, maxNodeMemoryBytes. Both CPU figures are in
cores.
Templated resources return the same compact digest the describe tool builds. The exceptions are
services/{id}/logs, the recent log lines; the two compose documents, which are YAML rather than JSON; the six image attestation views, read from the image’s registry when asked; and annotations/{id}, the annotation as the annotation tools return it.
cetacean://nodes/{id}- Node digest, by ID or hostname
cetacean://services/{id}- Service digest, by ID or name, with cross-references
cetacean://services/{id}/logs- Service logs merged across replicas, subscribable; not a digest
cetacean://services/{id}/compose- The service as a one-service Compose file; everything it references is external
cetacean://tasks/{id}- Task digest; the parent service and node are in
related, not top-level fields cetacean://services/{id}/provenance- The image’s build provenance per platform, as recorded and not verified, or why there is none
cetacean://tasks/{id}/provenance- The same for the image the task runs, on the platforms its node can run
cetacean://services/{id}/sbom{?platform}- One platform’s SBOM as a package table, never the SPDX document
cetacean://tasks/{id}/sbom{?platform}- The same for the platform of the task’s node
cetacean://services/{id}/dockerfile{?platform}- The embedded Dockerfile with the layers and bytes each instruction produced
cetacean://tasks/{id}/dockerfile{?platform}- The same for the platform of the task’s node
cetacean://stacks/{name}- Stack digest, rolling up its member resources
cetacean://stacks/{name}/compose- The stack as a Compose file; secrets and configs are referenced, never exported
cetacean://configs/{id}- Config digest; the payload’s size in bytes, never the payload
cetacean://secrets/{id}- Secret digest; the payload is never read, not even its length
cetacean://networks/{id}- Network digest, with the attached services and how many addresses are in use
cetacean://volumes/{name}- Volume digest, keyed by name
cetacean://annotations/{id}- One annotation with its
version; a removed resource is marked, subscribable
Subscriptions
On 2026-07-28 a client subscribes by opening a subscriptions/listen stream that names the notification types it
wants and the resource URIs to watch, and the server sends nothing the stream didn’t ask for. resources/subscribe is
gone from that revision. A 2025-11-25 client gets no subscriptions at all, since it has no stream to receive them on.
A watched URI may name its resource by ID or by name. The server sends notifications/resources/updated for it when
the resource changes, when one of its tasks changes for a service or a node, when any member changes for a stack, when
a task attached to it, any service, or for ingress a node changes for a network, and after a full resync, and the
client re-reads. A name keeps following whatever holds it: a service removed and created again under the same name, a
node that rejoins with the same hostname, the replica that takes over a <service>.<slot>, and a resource created
after the stream opened. A service’s logs URI is notified on the same changes as the service, not on every new line;
read new lines with get_logs and the previous cursor. An annotation’s URI is notified when the annotation is edited
or deleted, to a subscriber who may read it. The cluster overview, cetacean://history,
cetacean://recommendations, cetacean://annotations/tags, and the listing URIs are never notified. notifications/resources/list_changed fires
when resources are created or removed. Both are filtered by grants per notification: a client is only notified about
resources its identity can read, and through a service, node, or stack only when it can read that too. A network is
the exception: what moves its address count is notified to anyone who can read the network, since the notification
names nothing else.
One stream watches at most 256 resource URIs. A subscriptions/listen naming more is refused with an
Invalid params error; open a second stream, or watch the stack rather than each of its services.
Argument completion
Templated resource URIs and prompt arguments complete, offering resource names rather than IDs. Matching is
a case-insensitive substring, so typing prometheus offers monitoring_prometheus. Completions are capped at
100 values and are filtered by the caller’s grants like every other read.
Compact resource shapes
Tools and resource reads never return raw Docker objects—they’re enormous, and they don’t carry the field a caller actually wants, since a service’s health is derived from its tasks. Every read returns one of two shapes.
Row is one entry in a list, returned by find. Every row carries id, name, and type (singular:
service, node, task, and so on). stack, state, and detail (the most identifying secondary fact,
such as a service’s image, a node’s role, or a network’s driver) are omitted where they don’t apply.
desired and running are populated only where a replica count means something:
- services set both, the desired replica count and how many are running
- stacks set
desiredalone, counting member services rather than replicas - nodes, tasks, configs, secrets, networks, and volumes set neither
A config or secret listing, from find or a read of cetacean://configs or cetacean://secrets, shows the newest
version of each group of versions and every older one a service’s current spec uses, unless
versions is all; a find given query or label matches every version, while stack, state, node and
image keep the default. Config and secret rows carry usedBy, the number of services whose spec or previous spec
uses them, and, when they’re one of several versions, versionOf naming the group, versionInferred when it was
matched by name, inUse on an older one still in use, and on the newest newestVersion and olderVersions, the
number of older ones the listing hides. A config or secret digest carries the
same in details, and a subscription to one hears when another version in its group comes or goes. All of them
count only what the caller may read.
Digest is the detail view of one resource, returned by describe and by every templated
cetacean://<type>/{id} read. Alongside id, name, type, and state it adds:
version- The Swarm version index. Services, nodes, configs, and secrets only; a service’s or node’s is what a write takes as
version reason- The cause Swarm gave for a non-healthy
state; omitted when the state is healthy since- When the current state began: the oldest still-live failing task’s timestamp, or the resource’s own last-updated time
details- A type-specific map of facts, such as a service’s image, replica counts, reserved CPU and memory, ports, and placement constraints, or a node’s role and capacity
related- Always an array, even when empty: the resources this one references or is referenced by
recentFailures- Always an array: the task failures behind a failing state, newest first, capped at 5. Only a service digest populates it
restarts- A service’s involuntary task terminations as
lastHourandlastWeekcounts. Services only
restarts is the only field that reveals a restart loop. state reads running whenever a replica happens
to be up, and recentFailures drops tasks the orchestrator has already replaced, so a service crash-looping
every few seconds otherwise describes as healthy. lastHour answers whether it’s failing now; the ratio
between the two windows answers whether the fault is new.
A service’s details carries imageUpdate when its image tag names a newer image in its registry than the
digest the service runs, with the same fields as the API reports. suggestedImage, the tag pinned to
the newer digest, is what to pass to update_service_image. It’s absent with
server.image_check off.
A service’s details carries links when it declares custom links, and a stack’s details the
links of all its services, each naming the services that declare it, in the same shape as the API reports.
Every numeric field in details names its unit, such as cpuLimitCores (a float, in cores) and
memoryLimitBytes, or is reported as a duration string like "10s" (healthcheckInterval, an update
policy’s delay and monitor). Docker’s own types express these as unlabeled NanoCPU or nanosecond
integers. Environment variables are reported as envNames: names only, never values.
The raw: true option
Both find (when type is given) and describe accept raw: true, adding the untouched Docker record to
the result under raw. Use it only when a specific field a row or digest omits is needed; the compact shapes
exist to avoid handing an agent a several-hundred-line object.
Raw records ride beside the compact shape rather than replacing it: find adds a raw array with one record
per row, describe a raw object beside the digest.
Prompts
Prompts are named sequences a client offers from a menu. Picking one seeds the conversation with an investigation or a runbook. A prompt only seeds the conversation; every read and write it then describes goes through the normal tools, grant checks included.
A prompt’s level is the highest level of the tools it walks, so it’s never offered where one of its steps
would be refused. At the default level 0 you get the three diagnostic prompts; level 1 adds roll_back_service.
Prompts are filtered by grants too, all or nothing: you are offered a prompt only if you can use every tool it walks and can read every resource type in its Reads column. A caller whose grants match nothing is offered none.
diagnose_serviceserviceReadsserviceexplain_unschedulableserviceReadsservice, nodereview_capacityroll_back_serviceserviceReadsserviceright_size_serviceserviceReadsservicedrain_nodenodeReadsnode, serviceApps
A host that supports the MCP Apps extension can render Cetacean’s data as an interactive view instead of JSON.
Cetacean advertises io.modelcontextprotocol/ui and serves each widget as a resource. Each tool names its
widget in _meta, so a host knows which view fits the result; the same tool called from a client without app
support returns ordinary JSON.
MCP Apps are self-contained: they load nothing from the network and read data only through Cetacean’s MCP tools, so a widget shows exactly what the calling identity’s grants allow.
Picking a finding in the recommendations widget sends the model a message in the user’s name, and that message quotes resource names and finding text from the cluster. Whoever can name a service or node chooses part of it. The widget passes those fields as one JSON value marked as cluster data, but the model still reads them, so treat a follow-up from a widget as you would any output that quotes the cluster.
ui://cetacean/tablefind resultui://cetacean/topologyget_topology resultui://cetacean/logsget_logs resultui://cetacean/metricsget_metrics resultui://cetacean/recommendationsget_recommendations resultCompatibility
From 1.0, the parts of this catalog a client builds on don’t change within a major version. The general rules, including how a deprecation is announced, are under Compatibility in the API reference.
- Covered: tool names, argument names and types, resource URIs and URI templates, prompt names, and error codes.
- Tool results aren’t covered. Their shape is tuned for agents and token cost, and can change in a minor release. Changes are additive by default: a new field rather than a renamed or removed one.
- Except where a widget reads them. A result field a widget renders is covered, because a widget can’t adapt to a field that moved.
- Widgets: each
ui://cetacean/*URI, and which tool names which widget, are covered. What a widget looks like and how it behaves aren’t; the bundles ship with the server they render for.