register • AI Agent SDK
register: Register a tool with the registry.
register
Method
</div>
This is a method of the ToolRegistry class in the registry module.
Register a tool with the registry.
Thread-safe: Uses lock for concurrent access in multi-agent scenarios.
Signature
def register(tool: Union[BaseTool, Callable], name: Optional[str], overwrite: bool, trust_level: Optional[str], dynamic_schema_overrides: Optional[Callable[[Dict[str, Any]], Dict[str, Any]]]) -> NoneParameters
ParamField
Union[BaseTool, Callable]BaseTool instance or callable function
ParamField
Optional[str]Override name (default: tool.name or function.__name__)
ParamField
boolIf True, overwrite existing tool with same name
ParamField
Optional[str]Trust level for the tool (“trusted” or “external”)
ParamField
OptionalOptional function to dynamically modify tool schema. Called with base schema dict, returns modified schema dict.
Exceptions
ValueError
If tool with same name exists and overwrite=False
Uses
ToolTrustLevelValueErrorcallableTypeErrorlogging.debugToolEntry
Used By
Source
View on GitHubpraisonaiagents/tools/registry.py at line 122