***

title: to_json
slug: /reference/python/agents/pom-builder/to-json
description: Convert the POM to a JSON string.
max-toc-depth: 3
---------------------

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

Convert the POM to a JSON string.

## **Returns**

`str` -- JSON representation of the POM.

## **Example**

```python {7}
from signalwire.core.pom_builder import PomBuilder

pom = PomBuilder()
pom.add_section("Role", body="You are a helpful assistant.")
pom.add_section("Rules", bullets=["Be concise", "Be accurate"])

json_str = pom.to_json()
print(json_str)
```