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

# ToolFunctionDefinition

# ToolFunctionDefinition

Wraps a [FunctionSchema](/docs/reference/sdk/v2/python/types/FunctionSchema) inside a [ToolFunction](/docs/reference/sdk/v2/python/types/ToolFunction). Each tool in `deployment.prompt.tools` has a `definition` of this type.

## Import

```python theme={null}
from adaline_api.models.tool_function_definition import ToolFunctionDefinition
```

## Fields

<ParamField body="var_schema" type="FunctionSchema" required>
  The function schema. Aliased as `schema` in JSON — use `var_schema` in Python to avoid collision with the Python reserved word. See [FunctionSchema](/docs/reference/sdk/v2/python/types/FunctionSchema).
</ParamField>

***

## Example

```python theme={null}
from adaline_api.models.tool_function_definition import ToolFunctionDefinition
from adaline_api.models.function_schema import FunctionSchema

definition = ToolFunctionDefinition(
    var_schema=FunctionSchema(
        name="search_database",
        description="Search internal knowledge base",
        parameters={
            "type": "object",
            "properties": {
                "query": {"type": "string", "description": "Search query"},
                "limit": {"type": "number", "default": 10}
            },
            "required": ["query"]
        }
    )
)
```

### Accessing from a deployment

```python theme={null}
from adaline.main import Adaline

adaline = Adaline()
deployment = await adaline.get_latest_deployment(
    prompt_id="prompt_abc123",
    deployment_environment_id="environment_abc123"
)

for tool in deployment.prompt.tools:
    fn = tool.definition.var_schema
    print(f"{fn.name}: {fn.description}")
```

***

## Related

* [ToolFunction](/docs/reference/sdk/v2/python/types/ToolFunction) — parent type containing `definition`
* [FunctionSchema](/docs/reference/sdk/v2/python/types/FunctionSchema) — the schema held by this wrapper
