***

title: hasSection
slug: /reference/typescript/agents/pom-builder/has-section
description: Check if a top-level section with the given title exists.
max-toc-depth: 3
---------------------

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

Check if a top-level section with the given title exists.

## **Parameters**

<ParamField path="title" type="string" required={true} toc={true}>
  Section title to check.
</ParamField>

## **Returns**

`boolean` -- `true` if the section exists, `false` otherwise.

## **Example**

```typescript {6}
import { PomBuilder } from '@signalwire/sdk';

const pom = new PomBuilder();
pom.addSection('Role', { body: 'You are a helpful assistant.' });

console.log(pom.hasSection('Role'));    // true
console.log(pom.hasSection('Missing')); // false
```