Defining a Tool
Tool Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
name | str | required | Unique tool name |
description | str | required | What the tool does (shown to the LLM) |
agent | str | None | Agent to auto-register with |
max_retries | int | 3 | Retry count on failure |
retry_delay | float | 1.0 | Seconds between retries |
backoff_factor | float | 2.0 | Exponential backoff multiplier |
timeout | int | 300 | Execution timeout in seconds |
How Tools Work
- The LLM decides to call a tool and provides arguments
- AgentFlow validates the arguments against the tool’s schema
- The tool function is executed (with retry logic on failure)
- The result is serialized and fed back into the LLM’s context
- The LLM continues its response with the tool result
Tool Sharing
Tools are deduplicated by name in the global registry. A single tool instance can be shared across multiple agents:Secure Execution
For user-supplied or dynamic code, AgentFlow supports sandboxed execution via:- WASM sandboxing — isolated execution environment
- RestrictedPython — AST-level code restrictions