***

title: add_verb_to_section
slug: /reference/python/agents/swml-service/add-verb-to-section
description: Add a SWML verb to a specific named section of the document.
max-toc-depth: 3
---------------------

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

Add a verb to a specific named section of the SWML document. If the section does not
exist, it is created automatically before the verb is appended. Raises
`SchemaValidationError` if validation is enabled and the verb config is invalid.

## **Parameters**

<ParamField path="section_name" type="str" required={true} toc={true}>
  Name of the section to add the verb to (e.g., `"main"`, `"transfer_flow"`).
</ParamField>

<ParamField path="verb_name" type="str" required={true} toc={true}>
  The SWML verb name.
</ParamField>

<ParamField path="config" type="dict[str, Any] | int" required={true} toc={true}>
  Configuration dictionary for the verb, or a direct `int` for the `sleep` verb.
</ParamField>

## **Returns**

`bool` — `True` if the verb was added successfully, `False` if the config type was
invalid (non-dict for non-sleep verbs).

## **Example**

```python {10}
from signalwire import SWMLService

service = SWMLService(name="transfer-flow")

# Build the main section
service.add_verb("answer", {})
service.add_verb("ai", {"prompt": {"text": "You are a helpful assistant"}})

# Build a separate transfer section
service.add_verb_to_section("transfer", "connect", {
    "to": "+15551234567",
    "from": "+15559876543"
})

print(service.render_document())
```