Tool Call End • AI Agent SDK
tool_call_end: Emit tool call end event.
tool_call_end
Method
</div>
This is a method of the ContextTraceEmitter class in the context_events module.
Emit tool call end event.
Signature
def tool_call_end(agent_name: str, tool_name: str, result: Optional[str], duration_ms: float, error: Optional[str], cost_usd: float) -> NoneParameters
ParamField
strName of the agent
ParamField
strName of the tool called
ParamField
Optional[str]Tool result (will be smart-truncated to preserve key info)
ParamField
floatDuration in milliseconds
ParamField
Optional[str]Error message if any
ParamField
floatCost in USD (e.g., 0.001 for internet search = 1 credit)
Uses
ContextEventtime.time
Source
View on GitHubpraisonaiagents/trace/context_events.py at line 869