Quick Start
How It Works
| Phase | What happens |
|---|---|
| 1. Execute | Tool runs within the configured timeout |
| 2. Retry | Failed executions retry with exponential backoff |
| 3. Output | Large outputs spill to artifact storage |
| 4. Respond | Agent uses tool output to form the final answer |
Configuration Options
ToolConfig SDK Reference
Full parameter reference for ToolConfig
| Option | Type | Default | Description |
|---|---|---|---|
timeout | int | None | None | Per-tool timeout in seconds |
retry_policy | RetryPolicy | None | None | Retry with exponential backoff |
parallel | bool | False | Run batched LLM tool calls concurrently |
output_limit | int | 16000 | Max bytes before spilling to artifact store |
output_max_lines | int | None | None | Max lines before spilling |
output_direction | str | "both" | Truncation direction: "head", "tail", or "both" |
enable_artifacts | bool | False | Enable artifact storage for large outputs |
artifact_retention_days | int | 7 | Days to keep artifacts before cleanup |
artifact_store | Any | None | None | Custom artifact store instance |
redact_secrets | bool | True | Redact secrets from artifacts |
Common Patterns
Pattern 1 — Timeout for slow external APIs
Best Practices
Set a timeout for external tool calls
Set a timeout for external tool calls
Any tool that calls an external API or runs a subprocess should have a
timeout. Without one, a hung tool call blocks your agent indefinitely. Start with 30–60 seconds and adjust based on your tool’s expected latency.Enable parallel for independent tools
Enable parallel for independent tools
Use
parallel=True when your agent commonly calls multiple tools at once and those tools don’t depend on each other’s outputs. This can cut wall-clock time significantly.Enable artifacts for large data tools
Enable artifacts for large data tools
If your tools return large datasets (SQL queries, file reads, API responses), set
enable_artifacts=True. This prevents large outputs from filling the LLM context window, which wastes tokens and can cause errors.Keep redact_secrets=True
Keep redact_secrets=True
Leave
redact_secrets=True (the default) to prevent API keys, passwords, and tokens from being stored in artifact files or shown in tool outputs.Related
Artifact Storage
How artifacts are stored and retrieved
Async Tool Safety
Safe concurrent tool execution
Toolsets
Group and manage tools as sets
Tool Retry Policy
Configure retry behavior for failing tools

