Core agents
What is Tool Loop?
A tool loop repeats plan → call tool → observe until a stop condition.
Most agents are tool loops with optional planning and verification stages wrapped around the core cycle.
Visual
Tool loop cycle
One iteration of the core agent loop: decide → call → observe → repeat.
Why it matters
The tool loop is the heart of most agents. It repeats a cycle: the model decides what to do next, calls a tool, reads the result, and decides again. This loop continues until a stop condition fires.
Understanding the tool loop helps you see why agents can be powerful (they adapt to observations) and dangerous (they can loop forever if the stop condition is wrong).
Anatomy of a loop iteration
Each iteration has four phases. The model receives the current state and generates a tool-call request. The controller validates and executes the request. The tool returns a structured observation. The model reads the observation and decides whether to continue or stop.
The controller — not the model — owns execution. It enforces timeouts, rate limits, and permission checks.
Key takeaways
- 1The tool loop is the fundamental agent pattern: decide → call → observe → repeat.
- 2The controller owns execution; the model owns reasoning.
- 3Every loop must have a stop condition to prevent infinite cycling.
Common mistakes
- ✕Letting the model control execution directly without a controller layer.
- ✕Forgetting to set a maximum iteration count.
Related terms
Concept neighborhood
Terms linked from Tool Loop in the glossary graph.
- Tool Loop
- Tool Calling
- ReAct
- Stop Condition