Skip to main content

Parameters

ParameterTypeDefaultDescription
namestr-The name of the tool
descriptionOptional[str]NoneThe description of the tool
schemaOptional[ToolSchema]NoneThe schema for the tool
metadataOptional[ToolMetadata]NoneMetadata for the tool

Functions

execute

Execute the tool. Parameters:
  • *args (Any): Positional arguments
  • **kwargs (Any): Keyword arguments
Returns:
  • Any: The result of tool execution


title: ToolKit sidebarTitle: ToolKit

Parameters

No parameters - Base class for organized tool collections. Only @tool decorated methods are exposed.

Functions

No specific functions - Base class for tool collections.

title: ToolDefinition sidebarTitle: ToolDefinition

Parameters

ParameterTypeDefaultDescription
namestr-The name of the tool
parameters_json_schemaDict[str, Any]{'type': 'object', 'properties': {}}The JSON schema for the tool’s parameters
descriptionOptional[str]NoneThe description of the tool
kindToolKind'function'The kind of tool
strictOptional[bool]NoneWhether to enforce strict JSON schema validation
sequentialboolFalseWhether this tool requires a sequential/serial execution environment
metadataOptional[Dict[str, Any]]NoneTool metadata that is not sent to the model

Functions

defer

Whether calls to this tool will be deferred. Returns:
  • bool: True if the tool kind is ‘external’ or ‘unapproved’


title: ToolCall sidebarTitle: ToolCall

Parameters

ParameterTypeDefaultDescription
tool_namestr-The name of the tool to call
argsOptional[Dict[str, Any]]NoneThe arguments to pass to the tool
tool_call_idOptional[str]NoneThe tool call identifier
metadataOptional[Dict[str, Any]]NoneAdditional metadata for the tool call

Functions

No specific functions - Data class for tool call representation.

title: ToolResult sidebarTitle: ToolResult

Parameters

ParameterTypeDefaultDescription
tool_namestr-The name of the tool that was called
contentAny-The return value
tool_call_idOptional[str]NoneThe tool call identifier
successboolTrueWhether the tool execution was successful
errorOptional[str]NoneError message if the tool execution failed
metadataOptional[Dict[str, Any]]NoneAdditional metadata for the result
execution_timeOptional[float]NoneTime taken to execute the tool in seconds

Functions

No specific functions - Data class for tool execution result representation.

title: ToolMetadata sidebarTitle: ToolMetadata

Parameters

ParameterTypeDefaultDescription
namestr-The name of the tool
descriptionOptional[str]NoneThe description of the tool
versionOptional[str]NoneThe version of the tool
authorOptional[str]NoneThe author of the tool
tagsList[str][]Tags associated with the tool
customDict[str, Any]{}Custom metadata for the tool

Functions

No specific functions - Data class for tool metadata.

title: ToolSchema sidebarTitle: ToolSchema

Parameters

ParameterTypeDefaultDescription
parametersDict[str, Any]-JSON Schema for parameters
return_typeOptional[Dict[str, Any]]NoneJSON Schema for return type
strictboolFalseWhether to enforce strict schema validation

Functions

json_schema

Get the full JSON schema for the tool. Returns:
  • Dict[str, Any]: The complete JSON schema for the tool
I