Tool Server Topology
You configure which tools go to which processes via ToolServer factory functions. Each process type has its own tool set:Channel Tools
User-facing conversation management
Branch Tools
Memory and research operations
Worker Tools
Task execution and file operations
Cortex Tools
System-level memory consolidation
Channel Tools
Channels get conversation management tools. These hold per-turn state and are added dynamically at the start of each conversation turn.reply
Send a message to the user.The message text to send
src/tools/reply.rs
branch
Fork the channel’s context to think or research independently.What you need the branch to figure out
Maximum thinking iterations (default: 10)
src/agent/branch.rs
spawn_worker
Create an independent worker to execute a task.The work to delegate
Either
fire_and_forget (default) or interactiveMaximum execution time (1-3600 seconds)
- Fire-and-forget
- Interactive
route
Send follow-up input to an active interactive worker.The worker UUID
Follow-up instruction or question
cancel
Stop a running worker or branch.Worker ID or branch ID to cancel
skip
Opt out of responding this turn (silent action).react
Add an emoji reaction instead of a text reply.Emoji character or name (e.g., ”👍” or “thumbs_up”)
Branch Tools
Branches get memory and research tools. No channel context, just focused investigation.memory_save
Write a structured memory to the graph.The memory content
One of:
fact, preference, decision, identity, event, observationDecay resistance score (0.0-1.0, default: 0.5)
Related memory IDs with relationship types
memory_recall
Search the memory graph using hybrid vector + full-text search.Search query
Max results to return (default: 20)
Filter by types:
["fact", "decision"]Minimum importance threshold
src/memory/search.rs
memory_delete
Remove memories by ID or content match.Specific memory IDs to delete
Delete memories containing this text
channel_recall
Retrieve conversation history from other channels.Specific channel ID
Number of recent messages (default: 50)
task_create
Create a structured task with optional subtasks.Short task title
Detailed description
One of:
low, medium, high, urgentChecklist items as strings
Initial status:
backlog, todo, in_progress, done, cancelledtask_list
Query tasks with filters.Filter by status
Filter by priority
Max results (default: 50)
task_update
Update task fields or subtasks.Task number to update
New status
New priority
Mark subtasks as completed
Worker Tools
Workers get file and execution tools. Fresh prompt per worker—no channel history.shell
Execute shell commands in a sandboxed environment.Shell command to run (via
sh -c on Unix, cmd /C on Windows)Working directory (must be within workspace)
Command timeout (1-300 seconds, default: 60)
file
Read, write, or list files. All paths restricted to workspace.- Read
- Write
- List
exec
Run subprocesses with full argument and environment control.Binary name (e.g.,
cargo, python, node)Command arguments
Working directory
Environment variables as
{"key": "NAME", "value": "VALUE"}Execution timeout (1-300 seconds, default: 60)
Dangerous env vars (
LD_PRELOAD, PYTHONPATH, NODE_OPTIONS, etc.) are blocked for security.set_status
Update the worker’s visible status.Status message (e.g., “running tests”, “compiling”, “analyzing logs”)
MCP Tools
Model Context Protocol tools are dynamically loaded from configured MCP servers. Available to workers only.agent.toml
Tool Output Limits
Tool outputs are truncated to 50KB to fit within LLM context windows. If you hit truncation:
- Use
head/tailfor specific sections - Pipe commands through filters
- Read files with offset/limit parameters
Error-as-Result Pattern
Tool errors return as structured results, not exceptions. The LLM sees the error and can recover:Adding Custom Tools
Implement therig::tool::Tool trait:
create_worker_tool_server, create_branch_tool_server, etc.).