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

# swml_transfer

> Transfer the call to a SWML endpoint with a return message.

[connect]: /docs/server-sdks/reference/python/agents/function-result/connect

[functionresult]: /docs/server-sdks/reference/python/agents/function-result

Transfer the call to a SWML endpoint and configure an AI response for when
control returns to the agent (relevant only when `final=False`).

> **Tip**
>
> For simple phone-number or SIP transfers, use [`connect()`][connect] instead.
> Use `swml_transfer()` when you need to hand off to another SWML document and
> set up a return message.

## **Parameters**

**`dest`** `str` — required

Destination URL for the transfer (a SWML endpoint, SIP address, etc.).

---

**`ai_response`** `str` — required

Message the AI speaks when the transfer completes and control returns to the
agent. Only meaningful when `final=False`.

---

**`final`** `bool` — default: True

Whether this is a permanent transfer (`True`) or temporary (`False`).

---

## **Returns**

[`FunctionResult`][functionresult] — self, for chaining.

## **Example**

```python {12}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="transfer_to_support", description="Transfer to support SWML endpoint")
def transfer_to_support(args, raw_data):
    department = args.get("department", "support")
    return (
        FunctionResult("Let me connect you.", post_process=True)
        .swml_transfer(
            dest="https://support.example.com/swml",
            ai_response="The support call is complete. How else can I help?",
            final=False
        )
    )

agent.serve()
```