> 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. # toDict > Convert all contexts to a dictionary for SWML generation. Convert all contexts to a dictionary for SWML generation. Calls `validate()` first and throws `Error` if the configuration is invalid. ## **Returns** `Record` -- A mapping of context names to their serialized dictionaries, ready for inclusion in the SWML document. ## **Example** ```typescript {7} import { ContextBuilder } from '@signalwire/sdk'; const builder = new ContextBuilder(); const ctx = builder.addContext('default'); ctx.addStep('greet').setText('Hello!'); const data = builder.toDict(); // {"default": {"steps": [{"name": "greet", "text": "Hello!"}]}} ``` > Convert all contexts to a dictionary for SWML generation.