a2a-mod

Commands and tools

The /a2a commands you run, and the five tools Claude calls.

You run one command, /a2a, to add, list and remove workers. Claude gets five tools, workers, send, task, add_worker and remove_worker, and calls them itself when you ask it to use a worker.

The /a2a command

Run /a2a with no arguments to open the workers pane and print the usage text. With the minimal layout there is no pane, so you get the usage text only.

CommandWhat it does
/a2a add <url> [alias] [token flag]Fetch the worker's Agent Card and register it. The alias defaults to a slug of the card name. Run it again to refresh a worker.
/a2a listShow registered workers, their skills, and running tasks with their age.
/a2a remove <alias>Forget a worker, its running tasks and its run-time history.

<url> can be the worker's base URL or the URL of its Agent Card. If it ends in .json, the mod fetches it as the card. Otherwise it fetches /.well-known/agent-card.json from that host.

A worker that needs a bearer token takes one token flag on add. Worker tokens lists the flags and explains where each one reads the token from.

The tools Claude sees

You do not call these tools. Claude does, when you ask it to use a worker.

ToolWhat it does
workersLists the registered workers and their skills.
sendSends a task to a worker. It returns the answer if the worker finishes in time, and a task id otherwise.
taskReads the full state and result of a task, or cancels it.
add_workerRegisters a worker from a URL, after you approve a dialog.
remove_workerForgets a worker, after you approve a dialog.

send takes worker (the alias) and message. Pass taskId to answer a worker that asked for input, or contextId to continue a conversation.

task takes worker and taskId. Set cancel to true to cancel the task.

Adding and removing workers

add_worker takes url and an optional alias. It fetches the Agent Card the same way /a2a add does, then asks you to approve. The dialog shows the worker's name, alias, endpoint origin, A2A version, up to three skills, and whether the card asks for authentication. Choose Add or Cancel. If the alias is already registered, the dialog says it will refresh that worker's card, and the worker keeps its token source and any trusted endpoint.

remove_worker takes alias. It asks Remove <alias>? and says how many running tasks stop being tracked. An unknown alias gets an error that lists the known aliases, with no dialog.

The dialog shows on every call, whatever the permission mode. If you choose Cancel or dismiss it, Claude gets The user declined. and nothing changes. In a run with no one to ask, such as claude -p, Claude gets No one to approve this; ask the user to run /a2a add <url> themselves.

A worker Claude adds uses the tokens setting for its token, or none. The tools take no token, token command, token file or --trust-endpoint; for those, run /a2a add yourself. Worker tokens explains why.

Long results

send shows up to 8,000 characters of a result. If the worker returns more, the reply ends with a note that says how many characters were cut and points Claude to the task tool, which shows up to 100,000 characters.

What a worker sees

A message from send goes to the worker as a plain text message. The mod asks the worker to return at once instead of holding the connection, then polls for the result. How it works has the timing, and Write a worker shows the worker's side.

Edit this page