broadcast
Fan out a single message to all registered agents or filter by role for targeted announcements, avoiding one-by-one sends.
Instructions
Fan out a single message to every registered agent (or every agent of a given role).
When to use: announcements, fleet-wide pings, role-targeted prompts ('all builders, refresh your dependencies'). For 1:1 use send_message. For topical group coordination prefer post_to_channel, channels persist membership and avoid spamming agents who have explicitly opted out by leaving.
Behavior: stores one row per recipient with status='pending'; the sender is excluded from the recipient set. Fires one message.broadcast webhook event for the whole batch (delivery_id + idempotency_key in the envelope). Optional role narrows the recipient set. Same payload size cap as send_message (RELAY_MAX_PAYLOAD_BYTES).
Returns: { success: true, sent_to: string[], message_ids: string[], count, note }. count=0 with a note string when no other agents matched the filter (still success, not error).
Errors: AUTH_FAILED, PAYLOAD_TOO_LARGE, RATE_LIMITED.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | Sender agent name | |
| role | No | Only send to agents with this role | |
| content | Yes | Broadcast content (max 64KB by default; see RELAY_MAX_PAYLOAD_BYTES) | |
| agent_token | No | Your agent token (from register_agent response). Optional here — also resolvable from RELAY_AGENT_TOKEN env or X-Agent-Token header. |