All Prompts/Tool Prompts/Send Message Tool
πŸ”§Tool Prompts/swarm

Send Message Tool

src/tools/SendMessageTool/prompt.ts

Prompt Engineering Insight

Core swarm IPC: names vs broadcast; optional UDS/bridge addressing; legacy structured protocol for shutdown/plan approval.

Techniques Used

tool-use-guidancestructured-outputconditional-logicxml-tags
prompt
UDS_INBOX disabled
SendMessage
Send a message to another agent.
```json
{"to": "researcher", "summary": "assign task 1", "message": "start on task #1"}
```
| to | |
|---|---|
| "researcher" | Teammate by name |
| "*" | Broadcast to all teammates β€” expensive (linear in team size), use only when everyone genuinely needs it |${udsRow}
Your plain text output is NOT visible to other agents β€” to communicate, you MUST call this tool. Messages from teammates are delivered automatically; you don't check an inbox. Refer to teammates by name, never by UUID. When relaying, don't quote the original β€” it's already rendered to the user.${udsSection}
Protocol responses (legacy)
If you receive a JSON message with type: "shutdown_request" or type: "plan_approval_request", respond with the matching _response type β€” echo the request_id, set approve true/false:
```json
{"to": "team-lead", "message": {"type": "shutdown_response", "request_id": "...", "approve": true}}
{"to": "researcher", "message": {"type": "plan_approval_response", "request_id": "...", "approve": false, "feedback": "add error handling"}}
```
Approving shutdown terminates your process. Rejecting plan sends the teammate back to revise. Don't originate shutdown_request unless asked. Don't send structured JSON status messages β€” use TaskUpdate.
UDS_INBOX enabled (cross-session addressing)
SendMessage
Send a message to another agent.
```json
{"to": "researcher", "summary": "assign task 1", "message": "start on task #1"}
```
| to | |
|---|---|
| "researcher" | Teammate by name |
| "*" | Broadcast to all teammates β€” expensive (linear in team size), use only when everyone genuinely needs it |${udsRow}
Your plain text output is NOT visible to other agents β€” to communicate, you MUST call this tool. Messages from teammates are delivered automatically; you don't check an inbox. Refer to teammates by name, never by UUID. When relaying, don't quote the original β€” it's already rendered to the user.${udsSection}
Protocol responses (legacy)
If you receive a JSON message with type: "shutdown_request" or type: "plan_approval_request", respond with the matching _response type β€” echo the request_id, set approve true/false:
```json
{"to": "team-lead", "message": {"type": "shutdown_response", "request_id": "...", "approve": true}}
{"to": "researcher", "message": {"type": "plan_approval_response", "request_id": "...", "approve": false, "feedback": "add error handling"}}
```
Approving shutdown terminates your process. Rejecting plan sends the teammate back to revise. Don't originate shutdown_request unless asked. Don't send structured JSON status messages β€” use TaskUpdate.

Tags

swarmmessagingudscoordinator

Appears in use cases

This prompt is a step in curated flows that show how pieces of Claude Code connect for real tasks.