Quick Start
How It Works
The agent trackstool_call_count across iterations within a single chat turn:
- Before each batch: Checks if
tool_call_count >= max_tool_calls_per_turn - At limit: Stops execution with clear message
- Batch trimming: If batch would exceed limit, trims to remaining calls
- Reset: Counter resets for each new chat turn
When the limit is hit
Choosing a limit
| Scenario | Suggested value | Reasoning |
|---|---|---|
| Single-tool simple agent | 3–5 | Most tasks need 1-2 calls |
| Default agent | 10 (default) | Balanced for most use cases |
| Multi-tool research agent | 20–30 | Complex workflows need more steps |
| Long-running autonomous workflow | Use autonomy mode instead | Different protection mechanism |
Common Patterns
Pattern 1: Protecting Experimental Tools
Pattern 2: Complex Research Agent
Best Practices
Start with Default
Start with Default
Use the default limit (10) unless you have a specific reason to change it. It handles most use cases well.
Lower for Experimental Tools
Lower for Experimental Tools
Set 3-5 calls when testing new or potentially buggy tools to prevent token waste.
Higher for Legitimate Workflows
Higher for Legitimate Workflows
Increase to 20-30 for agents that need multiple tool calls for complex, multi-step tasks.
Monitor and Adjust
Monitor and Adjust
If agents hit the limit frequently on legitimate tasks, increase it. If they waste tokens on broken tools, decrease it.
Related
ExecutionConfig
Configure all execution limits
Autonomy Mode
DoomLoop protection for autonomous agents

