On Tool Call • AI Agent SDK
on_tool_call: Called when a tool is invoked.
on_tool_call
Method
</div>
This is a method of the ObservabilityAdapter class in the obs module.
Called when a tool is invoked.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
agent["Agent"] -- "uses" --> tool["Tool: on_tool_call"]
tool -- "returns" --> result["Result"]
style tool fill:#189AB4,color:#fff
style agent fill:#8B0000,color:#fff
style result fill:#8B0000,color:#fffSignature
def on_tool_call(span_id: str, tool_name: str, args: Dict[str, Any], result: Any, latency_ms: Optional[float]) -> NoneParameters
ParamField
strNo description available.
ParamField
strNo description available.
ParamField
Dict[str, Any]No description available.
ParamField
AnyNo description available.
ParamField
Optional[float]No description available.
Source
View on GitHubpraisonaiagents/obs/__init__.py at line 111