> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# define_native_tool

> Define a function the platform implements itself, under your own description and parameters.

[ref-agentbase]: /docs/server-sdks/reference/python/agents/agent-base

[define-tool]: /docs/server-sdks/reference/python/agents/agent-base/define-tool

[set-native-functions]: /docs/server-sdks/reference/python/agents/agent-base/native-functions

[set-functions]: /docs/server-sdks/reference/python/agents/context-builder/step/set-functions

Define a function that the platform implements itself, such as `end_call`, under
your own description and parameters. The function is sent with
`web_hook_url: "native"`, so the platform runs its own implementation by name and
calls no webhook. Use it to describe a platform function in your own words, or so
that a step's [function list][set-functions] can name it.

A tool from [`define_tool()`][define-tool] always gets the agent's webhook URL, so it
can't be a native function. To turn on the platform's built-in functions without
your own description, use [`set_native_functions()`][set-native-functions].

## Parameters

**`name`** `str` — required

The function's name, one the platform implements.

---

**`description`** `str` — required

The description the model reads.

---

**`parameters`** `dict[str, Any] | None` — default: None

The JSON Schema of its arguments, as the platform's implementation reads them.
`None` sends an empty object schema.

---

**`**swaig_fields`** `Any`

Other SWAIG function fields, such as `fillers`.

---

## Returns

[`AgentBase`][ref-agentbase] -- Self for method chaining.

## Example

```python {5}
from signalwire import AgentBase

agent = AgentBase(name="frontline", route="/frontline")
agent.prompt_add_section("Role", "You answer questions.")
agent.define_native_tool("end_call", "End the call once the caller says goodbye.")

agent.serve()
```

The rendered function:

```json
{
  "function": "end_call",
  "description": "End the call once the caller says goodbye.",
  "parameters": {"type": "object", "properties": {}},
  "web_hook_url": "native"
}
```