Tool turns are treated specially: a mid-response network failure surfaces
provider_outcome_unknown instead of silently re-running the tool. See Replay-Safe Retries.Quick Start
1
Built-in Tools
2
Custom Tool Function
3
Multiple Tools
Which Tools to Use?
How It Works
Common Patterns
Pattern 1 — Web research agent
Pattern 2 — Custom API tool
Pattern 3 — Tool search for large toolsets
Pattern 4 — Gate a custom tool behind approval
@tool decorator — the agent pauses and asks a human before the tool runs. See Tool Approval.
Tool Approval
Declare a tool needs human sign-off in one line
Timeouts
Cap how long a tool may run withToolConfig(timeout=...) — a stuck tool no longer hangs the agent.
Since PraisonAI PR #3790, async tool calls (The
await agent.achat(...)) honour the timeout. A tool that exceeds the limit returns a result instead of hanging forever:timeout: True flag marks the call terminal, so it is not retried — the executor thread cannot be cancelled, so a retry would launch a duplicate DB write, API call, or file mutation. Timeout results are surfaced immediately, the same rule already applied to approval_denied, permission_denied, and circuit_open. The framework’s own retry verdict lives on a private _praison_retryable key that is stripped before the result reaches the model or the caller, so it never appears on the surfaced dict.A tool’s own result may include a field called retryable (common for HTTP-API wrappers). That field is the tool’s payload — it never drives the framework’s retry loop.Best Practices
Write clear docstrings for custom tools
Write clear docstrings for custom tools
The LLM reads your tool’s docstring to decide when and how to use it. Write clear, specific descriptions: “Fetch the current stock price for a given ticker symbol (e.g., ‘AAPL’, ‘GOOGL’). Returns price in USD.”
Return strings from tools
Return strings from tools
Tools should return strings (or JSON-serializable data that gets converted to strings). Complex objects confuse the LLM — format results as readable text.
Use tool_search for large toolsets
Use tool_search for large toolsets
When you have more than 10–15 tools, enable
tool_search=True to let the agent dynamically find the right tools instead of sending all tool definitions with every request.Set timeouts for external tools
Set timeouts for external tools
Wrap external API calls with timeouts using
ToolConfig(timeout=30). Without timeouts, a slow API can block the entire agent run.Related
Tool Config — timeouts, retries, and artifact storage
Tool Search — dynamic tool discovery for large toolsets

