***

title: has_section / get_section
slug: /reference/python/agents/pom-builder/has-section
description: Check if a section exists and retrieve it by title.
max-toc-depth: 3
---------------------

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

## **has\_section**

Check if a section with the given title exists.

### **Parameters**

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

### **Returns**

`bool` -- `True` if the section exists, `False` otherwise.

***

## **get\_section**

Get a section by title for direct manipulation.

### **Parameters**

<ParamField path="title" type="str" required={true} toc={true}>
  Section title to look up.
</ParamField>

### **Returns**

`Optional[Section]` -- The POM Section object, or `None` if not found.

## **Example**

```python {6-7,10}
from signalwire.core.pom_builder import PomBuilder

pom = PomBuilder()
pom.add_section("Role", body="You are a helpful assistant.")

if pom.has_section("Role"):
    section = pom.get_section("Role")
    print(f"Found section: {section.title}")

print(pom.has_section("Missing"))  # False
```