Getting Started
Create a class that extendsToolKit and mark methods with @tool to expose them to the agent.
Filtering Tools
Control which methods are registered at instantiation time.include_tools — Add Non-Decorated Methods
Adds named methods to the tool set alongside any @tool-decorated ones.
exclude_tools — Remove Tools
Removes named methods. Always takes priority over include_tools and @tool.
Async Tools
Setuse_async=True to register all public async methods and drop all sync methods.
include_tools to keep a specific sync method:
Configuration
Toolkit-Wide Defaults
Pass config fields to__init__ to apply them to every tool in the toolkit.
Per-Tool Config via @tool
Set config on individual methods. The toolkit __init__ overrides overlapping fields.
| Source | Priority | Scope |
|---|---|---|
__init__ | Highest | All tools |
@tool() | Lower | Single tool |
Building Reusable ToolKits
Accept**kwargs and forward to super().__init__() so users can pass filtering and config parameters without modifying the class.
Runtime Tool Management
Add or remove tools after agent creation.Parameter Reference
| Parameter | Type | Effect |
|---|---|---|
include_tools | list[str] | Adds named methods to the tool set (additive) |
exclude_tools | list[str] | Removes named methods (always wins) |
use_async | bool | Registers all public async methods, drops all sync |
timeout | float | Execution timeout in seconds |
max_retries | int | Maximum retry attempts on failure |
requires_confirmation | bool | Pause for user confirmation before execution |
requires_user_input | bool | Pause and prompt the user for input before execution |
user_input_fields | list[str] | Field names to prompt the user for when requires_user_input is True |
external_execution | bool | Tool execution is handled by an external process |
show_result | bool | Show output to user instead of sending it back to the LLM |
stop_after_tool_call | bool | Terminate the agent run after this tool executes |
sequential | bool | Disable parallel execution for this tool |
cache_results | bool | Cache results based on arguments |
cache_dir | str | Directory to store cache files |
cache_ttl | int | Cache time-to-live in seconds |
tool_hooks | ToolHooks | Before/after callables for tool execution lifecycle |
strict | bool | Enforce strict JSON schema validation |
docstring_format | str | Docstring format: "google", "numpy", "sphinx", or "auto" |
require_parameter_descriptions | bool | Raise error if required parameter descriptions are missing |

