> ## 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 Execution Error • AI Agent SDK

> ToolExecutionError: Tool execution failed.

# ToolExecutionError

> Defined in the [**errors**](../modules/errors) module.

<Badge color="blue">AI Agent</Badge>

Tool execution failed.

Includes tool name and execution context for better debugging
and selective retry policies.

```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: ToolExecutionError"]
    tool -- "returns" --> result["Result"]
    style tool fill:#189AB4,color:#fff
    style agent fill:#8B0000,color:#fff
    style result fill:#8B0000,color:#fff
```

## Constructor

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

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

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

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

<ParamField query="error_category" type="AgentErrorKind" required={false} default="'unknown'">
  No description available.
</ParamField>

<ParamField query="is_retryable" type="bool" required={false} default="True">
  No description available.
</ParamField>

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

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/errors.py#L124">
  `praisonaiagents/errors.py` at line 124
</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>
