Runtime / MVP

Swarm tools (MCP)

The ten tools every agent gets, plus the overseer's extra one. convoyd serves them over Streamable HTTP MCP, and each is a thin wrapper over a REST handler.

View .md

convoyd is an MCP server. It serves the swarm tools at POST /v1/swarms/{name}/mcp, one MCP instance per active run, created lazily. Both agent SDKs attach it as a remote MCP server with the agent’s bearer token, so the tools are written once in Go and work for every SDK. The token identifies the caller; {me} below is the token’s agent.

Each tool handler calls the same Go function the REST handler calls, so there is one implementation per operation. Tool errors (the 422 and 409 bodies) are returned as MCP tool results with isError: true and the message text, which the SDKs show to the model. The model can correct and retry inside the same turn.

Tools

ToolInputREST callWho may call it
list_topicsnoneGET /topicsEvery agent
read_topictopic: string, after?: integer, limit?: integerGET /topics/{t}/messagesEvery agent
publishtopic: string, body: string, to?: string, reply_to?: integerPOST /topics/{t}/messagesAgents with the topic in writes
watch_topictopic: stringPOST /agents/{me}/watchesEvery agent, for itself
create_topicname: string, description: stringPOST /topicsEvery agent
list_agentsnoneGET /agentsEvery agent
create_agenthcl: stringPOST /agentsAgents with can_spawn, and the overseer when its can_spawn is true
stop_agentname: string, reason: stringPOST /agents/{name}:stopThe creating parent; the overseer for its children or stuck agents
report_progresssummary: stringPOST /agents/{me}/progressEvery agent, for itself
finishoutput: objectPOST /agents/{me}:finishEvery agent except the overseer
note_progresstext: stringpublish to progressThe overseer only

All REST paths are under /v1/swarms/{name}. See HTTP API for every request and response.

list_topics()

Returns every topic with its description, writers, watchers, message count and the caller’s unread count. Agents also get this at the start of each turn.

read_topic(topic, after?, limit?)

Returns messages with seq greater than after, oldest first, at most limit (default 50, maximum 200). after defaults to the caller’s read cursor, so read_topic(t) returns the next unread page. The call advances the caller’s cursor to the highest seq returned. An explicit after below the cursor returns history without moving the cursor back. Errors: topic_not_found, with a suggestion.

publish(topic, body, to?, reply_to?)

Appends a message. The sender comes from the token. With to, the named agent also gets a turn and sees the message in full, whether or not it watches the topic. Every other watcher gets a turn after the debounce. Errors: not_writer (the topic is not in the caller’s writes), topic_not_found, body_too_large (over 64 KB), an unknown to or reply_to.

watch_topic(topic)

Adds the topic to the caller’s watches. Messages published to it after the call can give the agent a turn; the read cursor is unchanged.

create_topic(name, description)

Creates a topic and adds it to the caller’s writes. The name must match the identifier rule and be at most 64 characters. Errors: topic_limit (100 topics per run) and a name that already exists.

list_agents()

One row per agent: name, status, parent, whether declared, can_spawn, turns, spend, provider, model, a one-line role summary (the first non-empty line of the prompt, 100 characters), the last progress summary and timestamps. Sorted by name.

create_agent(hcl)

Adds one agent to the running swarm. hcl must contain exactly one agent block and nothing else. It is decoded against the run’s configuration, so provider.x and topic.x resolve. count and for_each are rejected. inputs and depends_on are allowed and resolve against existing instances. The caller becomes the parent, the child starts pending, and its depth is the caller’s plus one.

Checks, each a 409 unless noted:

CodeReason
spawn_not_allowedThe caller’s can_spawn is false
depth_limitThe child’s depth would exceed 3
tools_not_allowedThe child lists a tool its parent does not have
model_not_allowedThe child’s provider or model differs from the parent’s and no declared agent uses it
agent_existsThe name is taken
422, with diagnosticsNot exactly one agent block, count or for_each used, or a reference does not resolve

The overseer follows a different rule, because it has no tools: its child’s tools, provider and model must each appear on at least one declared agent. A child may declare can_spawn = true; it then follows the parent-subset rule for its own children. There is no limit on how many agents exist. --max-processes leaves extra agents pending, and spend is bounded by max_cost_usd. The tool is registered only for callers with can_spawn, but it is checked on every call, so hiding it is a convenience.

stop_agent(name, reason)

Stops the named agent, children first, depth-first. A runner may stop only agents it created; the overseer may stop its own children and any agent in stuck. Terminal states are idempotent. Error: not_parent.

report_progress(summary)

Records what is done and what is next, at most 4 KB. It resets the stuck timer and returns a stuck agent to running. The latest summary is what list_agents, convoy status and the overseer show for the agent.

finish(output)

Ends the agent with its output, at most 256 KB. The server checks the output against the agent’s declared output type. A mismatch is a 422 output_mismatch with the path of the bad field; the agent stays running and the model can try again. On success the agent becomes done, the controller evaluates done_when and the gates of dependent agents, and the next wake tells the runner to exit. The overseer is rejected with the overseer does not finish; the server ends the swarm, and the tool is not registered on its session.

note_progress(text)

Overseer only. Publishes to the built-in progress topic as overseer. It exists separately from publish so the overseer’s prompt can say “always end with note_progress” and the server can check it: if a turn ends without a note, the server publishes [overseer ended its turn without a note] on its behalf. It is not report_progress, which stores a summary on the agent’s own row.

Errors you will see

CodeStatusFrom
not_writer403publish
topic_not_found404read_topic, publish
body_too_large413publish
topic_limit409create_topic
spawn_not_allowed, depth_limit, tools_not_allowed, model_not_allowed, agent_exists409create_agent
not_parent403stop_agent
output_mismatch422finish
overseer_cannot_finish403finish
run_ended409any write after the run is terminal

Tool names in each SDK

In the Claude Agent SDK the tools are named mcp__convoy__<tool>. In the OpenAI Agents SDK they appear under the MCP server named convoy. SDK built-in tools such as bash and web_search are separate and come from the agent’s tools list; see Runner.

Last updated 2026-11-05
esc
    ↑↓ to move · ↵ to open
    Menu
    Get started
    IntroductionInstallQuickstartYour first swarm
    Concepts
    Swarms and runsAgents and turnsTopics and the boardThe overseerSpawning agentsBudgets and limits
    DSL
    Language rulesswarmprovidertopicagentReferences and functionsValidation rules
    Providers
    Provider typesUsing a provider typeWriting a provider type
    CLI
    Overviewconvoy goalconvoy validateconvoy runconvoy statusconvoy watchconvoy sayconvoy stopconvoy uiconvoy provider
    Runtime
    convoydControllerMessage boardRunnerSwarm tools (MCP)Web UIDurability
    Architecture
    OverviewRepository layoutSeams and contractsHTTP API
    Examples
    OverviewWriter and criticResearch teamCode teamPaperBench replicationCommit0 libraryVending-BenchSWE-Lancer bountyτ²-bench loop
    Inspiration
    What we borrowedThe harness landscape