5 Tool-Calling Patterns Every Agent Needs
If your agent calls one tool at a time in a straight line, you are leaving performance and reliability on the table. Here are five patterns we use at Agentkit and how to implement them.
1. Sequential chain
The simplest pattern. Step A calls tool 1, passes the result to step B, which calls tool 2. Each step depends on the output of the previous one.
Use this when: later steps genuinely need earlier results. An invoice audit that first fetches invoices from Stripe, then analyzes them with Python, then cross-references with Postgres.
The trap: teams default to sequential when steps are actually independent. Check whether step B truly needs step A's output before chaining them.
2. Fan-out and merge
Multiple tools are called simultaneously. Results are collected and merged before the next step.
Use this when: you need data from multiple independent sources. Fetching a user's profile from your database, their recent orders from Stripe, and their support tickets from Zendesk — all at once.
In Agentkit, parallel tool execution is automatic when the runtime detects independent tool calls in the same step. Average speedup is 2–4x on fan-out heavy workflows.
3. Retry with fallback
A tool call fails. The agent retries with corrected parameters. If it fails again, it falls back to an alternative tool or approach.
Use this when: tools have unreliable availability or the agent might construct incorrect parameters on the first attempt.
Agentkit's runtime handles retry with exponential backoff by default. You configure the fallback:
4. Human-in-the-loop
The agent pauses execution and asks a human for confirmation before proceeding with a high-stakes action.
Use this when: the agent is about to send money, delete data, contact a customer, or make any irreversible change. Our runtime supports interrupts natively:
The agent run is suspended. The human reviews the proposed action in the dashboard. They approve or reject. Execution resumes or aborts.
5. Conditional branching
The agent evaluates a condition and routes to different tool chains depending on the result.
Use this when: outcomes are not uniform. An agent triaging support tickets might route refund requests to Stripe, technical bugs to Linear, and account questions to the CRM — all within the same run.
The model handles branching decisions naturally. Your job is to make sure each branch has the right tools available and that the trace captures which branch was taken and why.
Combining patterns
Real agents use all five. A typical Agentkit workflow fans out to gather data, chains the analysis sequentially, branches based on the result, retries failures with fallback, and interrupts for human approval before taking action.
The framework handles the orchestration. You define the tools and the guardrails.
