# Cap historical tool calls to control context size and spend

> A new parameter, max_tool_calls_from_history, lets you cap how many historical tool call pairs are loaded into context.

- Published: 2025-10-24
- Author: Agno Team
- Category: Changelog
- Canonical: https://agno-com-nine.vercel.app/articles/cap-historical-tool-calls-to-control-context-size-and-spend
- Markdown: https://agno-com-nine.vercel.app/articles/cap-historical-tool-calls-to-control-context-size-and-spend.md

A new parameter, max_tool_calls_from_history, lets you cap how many historical tool call pairs are loaded into context. This keeps token usage predictable, reduces costs, and lowers the risk of hitting context limits — especially for long-running sessions and tool-heavy agents.

**Details**

- Configurable at the agent, team, and workflow level
- Improves latency and reliability by preventing context bloat
- Backward compatible: defaults remain unchanged unless you set it

**Who this is for:** Platform owners and engineering teams running multi-turn or high-volume automations who need tighter cost and performance control.
