In this article
Budget successful tool executions separately from model turns, and handle limit failure as an explicit interrupted run rather than a normal final answer.
Budget the evidence collection work
A research agent can search, extract passages and inspect document metadata. The number of successful tool executions is a useful boundary when each operation consumes a limited service resource. Pydantic AI’s agent guide provides tool_calls_limit for this purpose. It differs from limiting model turns: a model response can request several tools, and a turn with no tool execution still contributes to the reasoning conversation.
Understand the parallel-batch check
The guide states that the limit is checked before tool execution. If the model returns parallel tool calls that would exceed the cap, none of those tools execute. Do not assume that the framework selects an affordable prefix and silently drops the rest. A caller collecting source evidence should be prepared for rejection of the whole pending batch, including tools whose individual cost would have fit within the remaining allowance.
Read the counter’s defined scope
The usage reference defines the cap in terms of successful tool calls. It is not a universal cap on every network attempt an implementation can make inside a tool. A tool that performs several external reads can generate more service traffic than its one successful invocation suggests. Model request limits, token limits and application-level service controls describe other dimensions of the workload and should be reviewed separately.
Preserve work when the limit interrupts execution
The exception reference describes UsageLimitExceeded; the run does not return an ordinary result when a usage limit is hit. It also documents capturing run messages to retain completed work. Capture the evidence already obtained and the pending batch identity where continuation is needed. Earlier external operations remain real operations; the later limit error does not undo them or invalidate their recorded observations.
Leave a path to an accepted report
Define whether exhausted collection should produce an explicit partial report through application handling or stop pending more authorized work. Task budgets explain the allowance, while tool observations explain the evidence actually collected. A helpful operational record distinguishes completed calls, an unexecuted rejected batch and remaining information gaps. That record prevents a user from reading the configured cap as proof that exactly that many source checks succeeded.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.