> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# add_function_include

> Add a remote function include to the SWAIG configuration.

[ai-swaig-includes]: /docs/swml/reference/ai/swaig/includes

[swml-swaig-includes-reference]: /docs/swml/reference/ai/swaig/includes

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

Add a remote SWAIG function include so the agent can call tools hosted on an external
server. The remote endpoint is contacted at session start and the listed functions
become available to the AI just like locally defined tools.

This maps to the SWML [`ai.swaig.includes`][ai-swaig-includes] array.
See the [SWML SWAIG includes reference][swml-swaig-includes-reference] for details.

## **Parameters**

URL of the remote SWAIG server that hosts the functions.

List of function names to include from the remote server.

Optional metadata dictionary passed along with the function include. Can be used
to provide authentication tokens or context to the remote server.

## **Returns**

[`AgentBase`][ref-agentbase] -- Returns self for method chaining.

## **Example**

```python {5}
from signalwire import AgentBase

agent = AgentBase(name="assistant", route="/assistant")
agent.set_prompt_text("You are a helpful assistant.")
agent.add_function_include(
    url="https://tools.example.com/swaig",
    functions=["lookup_order", "cancel_order"],
    meta_data={"auth_token": "secret-token"}
)
agent.serve()
```