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

# autogen.tools.tool

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### tool

```python theme={null}
tool(name: str | None = None, description: str | None = None) -> Callable[[Callable[..., Any]], Tool]
```

Decorator to create a Tool from a function.<br />

<b>Parameters:</b>

| Name          | Description                                                                                |
| ------------- | ------------------------------------------------------------------------------------------ |
| `name`        | The name of the tool.<br /><br />**Type:** str \| None<br /><br />**Default:** None        |
| `description` | The description of the tool.<br /><br />**Type:** str \| None<br /><br />**Default:** None |

<b>Returns:</b>

| Type                                                                              | Description                                                                               |
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| Callable\[\[Callable\[..., Any]], [Tool](/docs/api-reference/autogen/tools/Tool)] | Callable\[\[Callable\[..., Any]], Tool]: A decorator that creates a Tool from a function. |

<br />
