Quick Start
1
Simple Usage
2
With Configuration
Pass custom tool_name and description to as_tool() when the default labels are not clear enough for the parent LLM.
How It Works
as_tool() vs Handoffs
API Reference
Agent.as_tool()
str
Tool description for the LLM. Describes what this agent does.
Default:
"Invoke {agent_name} to complete a subtask and return the result"str
Custom tool name. Default:
invoke_{agent_name} (snake_case)Handoff
A Handoff configured with
ContextPolicy.NONE (no history passed to child).Examples
Research + Writing Pipeline
Research + Writing Pipeline
Code Review Pipeline
Code Review Pipeline
Multi-Step Analysis
Multi-Step Analysis
Best Practices
Clear Descriptions
Clear Descriptions
Provide clear tool descriptions so the LLM knows when to invoke each specialist.
Single Responsibility
Single Responsibility
Each specialist agent should have one clear purpose.
Avoid Deep Nesting
Avoid Deep Nesting
Keep hierarchies shallow (2-3 levels max) for clarity.
Test Individually
Test Individually
Test each specialist agent independently before composing.
Related
Handoffs
Transfer control between agents
Multi-Agent Workflows
Coordinate multiple agents
Toolsets
Create custom tools

