***

title: add_action
slug: /reference/python/agents/function-result/add-action
description: Append a raw action to the FunctionResult action list.
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

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

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

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

Append a raw action to the action list. Prefer the named convenience methods
([`connect()`][connect],
[`hangup()`][hangup],
[`say()`][say], etc.)
for common operations.

## **Parameters**

<ParamField path="name" type="str" required={true} toc={true}>
  Action type identifier (e.g., `"hold"`, `"hangup"`, `"set_global_data"`).
</ParamField>

<ParamField path="data" type="Any" required={true} toc={true}>
  Action payload. Can be a string, boolean, dict, or list depending on the action type.
</ParamField>

## **Returns**

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

## **Example**

```python {11-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="custom_action", description="Process a custom action")
def custom_action(args, raw_data):
    return (
        FunctionResult("Processing your request.")
        .add_action("set_global_data", {"status": "active"})
        .add_action("hold", 60)
    )

agent.serve()
```