Quick Start
1
Simple Usage
Use
ToolConfig() defaults to get retry protection and safe output limits:2
With Custom Settings
Configure timeout, retries, and parallel execution:
3
With Artifact Storage
How It Works
Configuration Options
ToolConfig SDK Reference
Full parameter reference for ToolConfig
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

