> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # PomBuilder > Build structured Prompt Object Model prompts with sections, subsections, and bullets. [agentbase]: /docs/server-sdks/reference/typescript/agents/agent-base [addsection]: /docs/server-sdks/reference/typescript/agents/pom-builder/add-section [addsubsection]: /docs/server-sdks/reference/typescript/agents/pom-builder/add-subsection [addtosection]: /docs/server-sdks/reference/typescript/agents/pom-builder/add-to-section [findsection]: /docs/server-sdks/reference/typescript/agents/pom-builder/find-section [getsection]: /docs/server-sdks/reference/typescript/agents/pom-builder/get-section [hassection]: /docs/server-sdks/reference/typescript/agents/pom-builder/has-section [rendermarkdown]: /docs/server-sdks/reference/typescript/agents/pom-builder/render-markdown [todict]: /docs/server-sdks/reference/typescript/agents/pom-builder/to-dict PomBuilder provides a fluent interface for creating structured prompts using the Prompt Object Model (POM). POM organizes prompt content into titled sections, subsections, and bullet lists -- producing consistent, well-structured prompts that the AI can follow reliably. Use PomBuilder when you need fine-grained control over prompt structure beyond what `setPromptText()` and `promptAddSection()` on [`AgentBase`][agentbase] provide. The builder can render to Markdown format. ## **Methods** #### [addSection](/docs/server-sdks/reference/typescript/agents/pom-builder/add-section) Add a new top-level section to the POM. #### [addSubsection](/docs/server-sdks/reference/typescript/agents/pom-builder/add-subsection) Add a subsection to an existing section. #### [addToSection](/docs/server-sdks/reference/typescript/agents/pom-builder/add-to-section) Add content to an existing section. #### [findSection](/docs/server-sdks/reference/typescript/agents/pom-builder/find-section) Find a section by title for direct manipulation. #### [getSection](/docs/server-sdks/reference/typescript/agents/pom-builder/get-section) Get a top-level section by title. #### [hasSection](/docs/server-sdks/reference/typescript/agents/pom-builder/has-section) Check if a section with a given title exists. #### [renderMarkdown](/docs/server-sdks/reference/typescript/agents/pom-builder/render-markdown) Render the POM as a Markdown string. #### [renderXml](/docs/server-sdks/reference/typescript/agents/pom-builder/render-xml) Render the POM as an XML document. #### [toDict](/docs/server-sdks/reference/typescript/agents/pom-builder/to-dict) Convert the POM to a list of section objects. #### [toJson](/docs/server-sdks/reference/typescript/agents/pom-builder/to-json) Serialize all sections to a JSON string. #### [fromSections](/docs/server-sdks/reference/typescript/agents/pom-builder/from-sections) Create a new PomBuilder from section data (static). #### [addPomAsSubsection](/docs/server-sdks/reference/typescript/agents/pom-builder/add-pom-as-subsection) Append another PomBuilder's sections as subsections. #### [pom](/docs/server-sdks/reference/typescript/agents/pom-builder/pom) Get a PromptObjectModel snapshot of the builder's sections. #### [reset](/docs/server-sdks/reference/typescript/agents/pom-builder/reset) Clear all sections and start over. ## **Examples** ### Building a structured prompt ```typescript {3} import { PomBuilder } from '@signalwire/sdk'; const pom = new PomBuilder(); pom.addSection('Role', { body: 'You are a helpful assistant.' }); pom.addSection('Rules', { bullets: ['Be concise', 'Be accurate'] }); const markdown = pom.renderMarkdown(); console.log(markdown); ``` ### Incremental construction ```typescript {3} import { PomBuilder } from '@signalwire/sdk'; const pom = new PomBuilder(); // Start with a basic section pom.addSection('Capabilities', { body: 'You can help with the following:' }); // Add bullets incrementally as skills are loaded pom.addToSection('Capabilities', { bullet: 'Weather lookups' }); pom.addToSection('Capabilities', { bullet: 'Calendar scheduling' }); pom.addToSection('Capabilities', { bullets: [ 'Order tracking', 'Account management', ] }); // Add a subsection pom.addSubsection('Capabilities', 'Limitations', { body: 'You cannot process payments directly.', }); console.log(pom.renderMarkdown()); ``` > Build structured Prompt Object Model prompts with sections, subsections, and bullets. ## Docs - [addPomAsSubsection](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/add-pom-as-subsection.md): Append another PomBuilder's sections as subsections of a target section. - [addSection](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/add-section.md): Add a new top-level section to the POM. - [addSubsection](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/add-subsection.md): Add a subsection to an existing section. - [addToSection](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/add-to-section.md): Add content to an existing section. - [findSection](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/find-section.md): Recursively search all sections and subsections for a matching title. - [fromSections](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/from-sections.md): Create a new PomBuilder from an array of section data objects (static). - [getSection](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/get-section.md): Retrieve a top-level POM section by its title. - [hasSection](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/has-section.md): Check if a top-level section with the given title exists. - [pom](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/pom.md): Get a PromptObjectModel snapshot of the builder's current sections. - [renderMarkdown](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/render-markdown.md): Render all POM sections as a combined Markdown string. - [renderXml](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/render-xml.md): Render all sections as a combined XML document. - [reset](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/reset.md): Clear all sections and return the builder to its initial empty state. - [toDict](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/to-dict.md): Convert the POM to a list of section data objects. - [toJson](https://signalwire.com/docs/server-sdks/reference/typescript/agents/pom-builder/to-json.md): Serialize all sections to a JSON string.