Skip to main content

Attributes

Custom tools support comprehensive configuration through the @tool decorator:
AttributeTypeDefaultDescription
requires_confirmationboolFalseRequire user confirmation before execution
requires_user_inputboolFalsePrompt user for input during execution
user_input_fieldsList[str][]Specify which fields require user input
external_executionboolFalseMark tool for external execution
show_resultboolFalseDisplay output to user instead of sending to LLM
stop_after_tool_callboolFalseTerminate agent run after tool execution
sequentialboolFalseEnforce sequential execution (no parallelization)
cache_resultsboolFalseEnable result caching
cache_dirstr | NoneNoneDirectory for cache storage
cache_ttlint | NoneNoneCache time-to-live in seconds
tool_hooksToolHooks | NoneNoneBefore/after execution hooks
max_retriesint5Maximum retry attempts
timeoutfloat | None30.0Execution timeout in seconds
strictbool | NoneNoneEnforce strict JSON schema validation
docstring_formatstr"auto"Docstring parsing format: ‘google’, ‘numpy’, ‘sphinx’, ‘auto’
require_parameter_descriptionsboolFalseRequire descriptions for all parameters in docstring
instructionsstr | NoneNoneInstructions for the LLM on how to use this tool, injected into the system prompt
add_instructionsboolFalseIf True, the tool’s instructions will be appended to the agent’s system prompt

Example Usage

requires_confirmation=True is designed for interactive environments where a user can respond to confirmation prompts. When running scripts non-interactively, remove this attribute or set it to False to avoid blocking.