***

title: swml_transfer
slug: /reference/python/agents/function-result/swml-transfer
description: Transfer the call to a SWML endpoint with a return message.
max-toc-depth: 3
---------------------

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

[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.
</Tip>

## **Parameters**

<ParamField path="dest" type="str" required={true} toc={true}>
  Destination URL for the transfer (a SWML endpoint, SIP address, etc.).
</ParamField>

<ParamField path="ai_response" type="str" required={true} toc={true}>
  Message the AI speaks when the transfer completes and control returns to the
  agent. Only meaningful when `final=False`.
</ParamField>

<ParamField path="final" type="bool" default="True" toc={true}>
  Whether this is a permanent transfer (`True`) or temporary (`False`).
</ParamField>

## **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()
```