> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool End • AI Agent SDK

> tool_end: Emit tool end event.

# tool\_end

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**TraceEmitter**](../classes/TraceEmitter) class in the [**protocol**](../modules/protocol) module.

Emit tool end event.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    agent["Agent"] -- "uses" --> tool["Tool: tool_end"]
    tool -- "returns" --> result["Result"]
    style tool fill:#189AB4,color:#fff
    style agent fill:#8B0000,color:#fff
    style result fill:#8B0000,color:#fff
```

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def tool_end(tool_name: str, duration_ms: float, status: str, result_summary: Optional[str], agent_name: Optional[str], agent_id: Optional[str], error_message: Optional[str], metadata: Optional[Dict[str, Any]]) -> None
```

## Parameters

<ParamField query="tool_name" type="str" required={true}>
  No description available.
</ParamField>

<ParamField query="duration_ms" type="float" required={true}>
  No description available.
</ParamField>

<ParamField query="status" type="str" required={false} default="'ok'">
  No description available.
</ParamField>

<ParamField query="result_summary" type="Optional[str]" required={false}>
  No description available.
</ParamField>

<ParamField query="agent_name" type="Optional[str]" required={false}>
  No description available.
</ParamField>

<ParamField query="agent_id" type="Optional[str]" required={false}>
  No description available.
</ParamField>

<ParamField query="error_message" type="Optional[str]" required={false}>
  No description available.
</ParamField>

<ParamField query="metadata" type="Optional" required={false}>
  No description available.
</ParamField>

## Uses

* `ActionEvent`
* `time.time`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/trace/protocol.py#L316">
  `praisonaiagents/trace/protocol.py` at line 316
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Tools Concept" icon="wrench" href="/docs/docs/concepts/tools" />

  <Card title="Create Custom Tools" icon="plus" href="/docs/docs/guides/tools/create-custom-tools" />

  <Card title="Tool Development" icon="code" href="/docs/docs/tutorials/advanced-tool-development" />
</CardGroup>
