> ## 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.get_function_schema

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

#### get\_function\_schema

```python theme={null}
get_function_schema(
    f: Callable[..., Any],
    *,
    name: str | None = None,
    description: str
) -> dict[str, Any]
```

Get a JSON schema for a function as defined by the OpenAI API

<b>Parameters:</b>

| Name          | Description                                                                            |
| ------------- | -------------------------------------------------------------------------------------- |
| `f`           | The function to get the JSON schema for<br /><br />**Type:** Callable\[..., Any]       |
| `name`        | The name of the function<br /><br />**Type:** str \| None<br /><br />**Default:** None |
| `description` | The description of the function<br /><br />**Type:** str                               |

<b>Returns:</b>

| Type                   | Description                    |
| ---------------------- | ------------------------------ |
| dict\[str, typing.Any] | A JSON schema for the function |

<br />
