Tool Configuration
This page provides comprehensive documentation for configuring tools in PraisonAI, including timeout settings, performance optimization, error handling, and resource management.Tool Timeout Configuration
Basic Timeout Settings
Agent-Level Tool Timeout
Each agent can set atool_timeout that applies to all tool executions. When a tool times out, it returns a standardized error dict:
- Each agent has its own 2-thread tool executor (reused across calls)
- Timed-out tools return
{"error": "Tool timed out after Ns", "timeout": True}rather than raising - Thread names are prefixed
tool-<agent_name>— useful for debugging
For complete concurrency control documentation including per-agent limits and sync/async patterns, see Concurrency.
Advanced Timeout Configuration
Dynamic Timeout Calculation
Performance Tuning
Resource Management
Tool Execution Strategies
Performance Monitoring
Tool-Specific Configurations
Web Scraping Tools
Database Tools
API Tools
File Processing Tools
Error Handling Configuration
Resource Pooling
Complete Tool Configuration Example
Environment Variables
Best Practices
Timeout Guidelines
-
Set appropriate timeouts based on tool type
- Fast operations: 5-15 seconds
- API calls: 15-30 seconds
- Web scraping: 30-60 seconds
- Data processing: 60-300 seconds
-
Use dynamic timeouts for variable workloads
-
Always set connection timeouts lower than read timeouts
Performance Optimization
- Enable caching for idempotent operations
- Use connection pooling for repeated operations
- Implement circuit breakers for unreliable services
- Monitor and alert on performance degradation
See Also
- Tool Development - Creating custom tools
- Agent Configuration - Agent-level tool settings
- Best Practices - Configuration guidelines

