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.

Diagram

uses

returns

Agent

Tool: tool_call_end

Result

Signature

python
def tool_call_end(agent_name: str, tool_name: str, result: Optional[str], duration_ms: float, error: Optional[str], cost_usd: float) -> None

Parameters

ParamField str

Name of the agent

ParamField str

Name of the tool called

ParamField Optional[str]

Tool result (will be smart-truncated to preserve key info)

ParamField float

Duration in milliseconds

ParamField Optional[str]

Error message if any

ParamField float

Cost in USD (e.g., 0.001 for internet search = 1 credit)

Uses

  • ContextEvent
  • time.time

Source

View on GitHub

praisonaiagents/trace/context_events.py at line 869


Related Documentation