The number of tools you can realistically define depends on a few things: your model’s context window, how complex each tool is, and overall performance.
Here’s a simple way to think about it:
Context Window Considerations
Every tool definition takes up space in your context window
The more detailed or complex the schema, the more tokens it eats
Models like Claude 3.5 Sonnet (with a 200K context) give you more room to play with, but you still want to be intentional
What’s Practical
10–15 tools: This is the sweet spot for most setups
20–30 tools: Still doable, but you’ll want to keep an eye on performance
50+ tools: Generally not ideal — you’ll start seeing:
Slower responses
Higher token usage
Lower accuracy when picking between tools
Pressure on the context window
Best Practices
Keep tool descriptions as clear and concise as possible
Don’t over-engineer schemas — simple is better
If multiple tools are tightly related, consider combining them
Load tools dynamically when you can
Keep an eye on token usage and the model’s output quality over time
When to Start Modularizing
When you hit 10–15 tools, it’s a good time to think about structure:
Group tools by domain or purpose
Load tools only when the model needs them
Use routing or intent detection to direct which tool gets used
The AI SDK already gives you helpful utilities for managing all this, so you can tune things based on your actual token usage and workflow.