# AgentTool

**Package:** `flyte.ai.agents`

A normalized tool descriptor used by :class:`Agent`.

Most users do not construct :class:`AgentTool` directly — pass plain
callables, ``@flyte.trace`` helpers, or ``@env.task`` templates to
:class:`Agent` and they will be wrapped automatically. Build one
explicitly when you need to:

- rename a tool for the LLM,
- override the description shown to the model,
- require human approval before execution (HITL),
- inject a fully custom JSON schema.

## Parameters

```python
class AgentTool(
    name: str,
    description: str,
    parameters: dict[str, Any],
    execute: _ToolExecutor,
    requires_approval: bool,
    source: Literal['function', 'task', 'trace', 'remote_task', 'mcp', 'custom'],
)
```
| Parameter | Type | Description |
|-|-|-|
| `name` | `str` | |
| `description` | `str` | |
| `parameters` | `dict[str, Any]` | |
| `execute` | `_ToolExecutor` | |
| `requires_approval` | `bool` | |
| `source` | `Literal['function', 'task', 'trace', 'remote_task', 'mcp', 'custom']` | |

## Methods

| Method | Description |
|-|-|
| [`to_openai_format()`](#to_openai_format) | Convert to the OpenAI / litellm tools schema. |

### to_openai_format()

```python
def to_openai_format()
```
Convert to the OpenAI / litellm tools schema.

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/flyte-sdk/packages/flyte.ai.agents/agenttool.md
**HTML**: https://www.union.ai/docs/v2/union/api-reference/flyte-sdk/packages/flyte.ai.agents/agenttool/
