Skip to main content
Tool Config controls how tools run — their timeout, retry behavior, output limits, and whether large results get stored as artifacts.
By default an agent can only call the tools you list in tools=[...]. If you rely on @tool-decorated callables being auto-discovered from anywhere in the process, opt in with ToolConfig(allow_global_tools=True).
ToolConfig.parallel is a deprecated alias for ExecutionConfig.parallel_tool_calls, the single source of truth for running batched LLM tool calls in parallel. Prefer execution=ExecutionConfig(parallel_tool_calls=True). ToolConfig(parallel=True) still works, but do not set both spellings to conflicting values — that raises TypeError.
The user asks the agent to use tools; ToolConfig controls timeouts, retries, parallel execution, and artifact storage for those calls.

Quick Start

1

Simple Usage

Use ToolConfig() defaults to get retry protection and safe output limits:
2

With Custom Settings

Configure timeout and output limits on ToolConfig, and enable parallel tool calls with ExecutionConfig:
3

With Artifact Storage


How It Works


Configuration Options

ToolConfig SDK Reference

Full parameter reference for ToolConfig
Precedence ladder:
Legacy keyword arguments for tools now raise TypeError. Always use ToolConfig for tool configuration. See the migration guide if upgrading from an older version.

Common Patterns

Pattern 1 — Timeout for slow external APIs

Parallel tool execution:
Set parallel tool calls in one place. Setting ToolConfig(parallel=...) and ExecutionConfig(parallel_tool_calls=...) to conflicting values raises TypeError at Agent(...) construction:
Tail-only output for log tools:
Plugin-host: allow global @tool discovery:

Best Practices

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.
Use execution=ExecutionConfig(parallel_tool_calls=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. ExecutionConfig.parallel_tool_calls is the single source of truth; ToolConfig(parallel=True) is a deprecated alias for it.
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.
Leave redact_secrets=True (the default) to prevent API keys, passwords, and tokens from being stored in artifact files or shown in tool outputs.
Any module in the process that imports an @tool-decorated function auto-registers it globally. With allow_global_tools=True, every such tool becomes callable by this agent whether you passed it or not — including unsafe ones from unrelated modules. Only opt in when your agent’s whole point is dynamic dispatch over the registry.

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