Skip to main content
Tools give agents the ability to take actions — search the web, run code, read files, and call APIs — beyond what an LLM knows from training.
The user asks a research question; the agent calls web search and returns an answer grounded in live results.
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

Drop a @tool-decorated function into .praisonai/tools/*.py for auto-load with no imports required — see Project-local tools.

Pattern 3 — Tool search for large toolsets

Pattern 4 — Gate a custom tool behind approval

Declare approval right on the @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 with ToolConfig(timeout=...) — a stuck tool no longer hangs the agent.
Since PraisonAI PR #3790, async tool calls (await agent.achat(...)) honour the timeout. A tool that exceeds the limit returns a result instead of hanging forever:
The 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

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.”
Tools should return strings (or JSON-serializable data that gets converted to strings). Complex objects confuse the LLM — format results as readable text.
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.
Wrap external API calls with timeouts using ToolConfig(timeout=30). Without timeouts, a slow API can block the entire agent run.

Tool Config — timeouts, retries, and artifact storage
Tool Search — dynamic tool discovery for large toolsets