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

# addVerbToSection

> Add a SWML verb to a specific named section of the document.

[ref-addsection]: /docs/server-sdks/reference/typescript/agents/swml-service/add-section

[ref-addverb]: /docs/server-sdks/reference/typescript/agents/swml-service/add-verb

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

<Note>
  Use [`addSection()`][ref-addsection] first to create an empty section if you
  prefer explicit creation, or use this method directly and let it auto-create.
  For the default `main` section, use [`addVerb()`][ref-addverb] instead.
</Note>

## **Parameters**

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

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

<ParamField path="config" type="unknown" required={true} toc={true}>
  Configuration for the verb. Typically a `Record<string, unknown>` object;
  certain verbs like `sleep` accept a bare number.
</ParamField>

## **Returns**

`this` -- returns the service for fluent chaining.

## **Example**

```typescript {10}
import { SWMLService } from '@signalwire/sdk';

const service = new SWMLService({ name: 'transfer-flow' });

// Build the main section
service.addVerb('answer', {});
service.addVerb('ai', { prompt: { text: 'You are a helpful assistant' } });

// Build a separate transfer section
service.addVerbToSection('transfer', 'connect', {
  to: '+15551234567',
  from: '+15559876543',
});

console.log(service.renderDocument());
```