Tool Composition Patterns
Orchestrate multiple tools into sophisticated, powerful agent workflows
Your Progress
0 / 5 completedSequential Composition: Step-by-Step Execution
Sequential composition is the simplest pattern: tools execute one after another, with each tool receiving the output of the previous step. Like an assembly line, data flows through a series of transformations.
This pattern works best when each tool depends on the previous result to do its job.
Interactive: Sequential Execution Demo
Watch tools execute one after another in a research workflow
1
search_web
Search for information
2
extract_content
Extract content from articles
3
analyze_sentiment
Analyze sentiment
4
generate_summary
Generate final summary
Common Sequential Patterns
Pipeline
Linear sequence where each tool processes the previous result
Example:
fetch β transform β validate β save
β Simple, predictable data flow
β Slow for independent operations
Chain
Each tool depends on previous output to determine action
Example:
query_db β if empty: search_api β merge_results
β Flexible, adaptive to intermediate results
β More complex error handling
Waterfall
Sequential stages with validation checkpoints
Example:
draft β review β approve β publish
β Quality gates, rollback capability
β Cannot skip stages easily
Best Practices for Sequential Composition
β
Minimize sequential steps
Each step adds latencyβonly sequence when necessary
π
Pass minimal data
Large data transfers between tools slow execution
β οΈ
Handle errors at each step
One failure shouldnt crash the entire sequence
π
Log intermediate results
Essential for debugging complex sequences