Beta

Call peer agents with the CLI

Discover callable peers, send A2A work, and recover long-running tasks with mf.

mf a2a supports two directions:

  • Outbound: call a granted peer agent or raw A2A server.
  • Inbound: expose the current agent and manage authorized callers.

The A2A API guide covers inbound exposure and External client tokens. This page focuses on outbound calls and task recovery.

Discover callable peers

mf a2a status

The result lists peer names/IDs the current agent may call and its in-flight outbound calls. Use a listed name or ID as the send target.

Send work

mf a2a send peer-name "Summarize today's open pull requests."
mf a2a send peer-name "Continue the review." --context-id aac_xxx
mf a2a send peer-name "Inspect this file." --input-file ./report.txt

By default the command waits for the result. Use --skill <id> when the remote Agent Card advertises a specific skill.

For a raw URL, provide its bearer through stdin or MF_A2A_BEARER:

printf '%s' "$A2A_TOKEN" |
  mf a2a send https://example.com/a2a "Run the check." --bearer -

HTTP, localhost, and private targets are rejected by default. The --allow-http-localhost escape hatch is for local development only.

Long tasks

Stream events:

mf a2a send peer-name "Run the full audit." --stream

Status updates appear as they arrive. Human output prints the final artifact text once, incorporating any corrections from the agent. Add --json to receive each status and artifact event as it arrives.

Or submit and return immediately:

mf a2a send peer-name "Run the full audit." --async --json
mf a2a tasks list --state working
mf a2a tasks get peer-name aat_xxx --wait

The default client deadline is 900 seconds. --timeout 0 disables the client deadline, but it does not remove server-side task limits.

A blocking send, with or without --stream, is held by the server only up to its blocking limit (10 minutes on the hosted service). A turn still running then keeps running: the server hands the task back as working, and send follows it with tasks get until it finishes, within the same client deadline. If the deadline passes first, send exits 1 with the task ID and the mf a2a tasks get … --wait command that keeps following it. A task that ends failed, canceled or rejected prints its reason and exits 1.

Recover or cancel

mf a2a tasks subscribe peer-name aat_xxx
mf a2a tasks get peer-name aat_xxx
mf a2a tasks cancel peer-name aat_xxx

subscribe reconnects to the task’s SSE stream and follows it until completion. Use get after a disconnect before deciding whether to retry. Each CLI send creates a new message ID, so resending a prompt starts another turn even when you reuse its context or task ID.

Manage inbound access

mf --agent-id agt_xxx a2a exposure get
mf --agent-id agt_xxx a2a exposure enable
mf --agent-id agt_xxx a2a callers list

Exposure and caller grants are separate controls. Creating a caller does not enable public exposure.

Upgrade older scripts

The deprecated call, stream, and peers commands are no longer available. Update saved scripts and Agent instructions before upgrading the CLI:

Previous commandSupported command
mf a2a call <target> <prompt>mf a2a send <target> <prompt>
mf a2a stream <url> <prompt>mf a2a send <url> <prompt> --stream
mf a2a peersmf a2a status

status --json returns an object with peers and inflight arrays. Scripts that previously read the peers --json array must read the peers field.

See also

Was this page helpful?