> 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. # validate > Validate the entire context configuration tree. Validate the entire context configuration. Called automatically during SWML rendering, but can be called manually to catch errors early. Checks performed: * At least one context exists. * A single context is named `"default"`. * Every context has at least one step. * Each context's `initial_step` (if set) references a real step in that context. * All context-level `valid_contexts` references point to contexts that exist in the builder. * All step-level `valid_steps` references point to real step names (or the literal `"next"`) in the same context. * All step-level `valid_contexts` references point to contexts that exist in the builder. * All `gather_info` question keys are unique within a single step. * All `gather_info` `completion_action` targets point to `"next_step"` or a real step in the same context. * No user-defined SWAIG tool collides with the reserved native tool names (`next_step`, `change_context`, `gather_submit`). ## **Returns** `void` -- Throws `Error` with a descriptive message if validation fails. ## **Example** ```typescript {8} import { ContextBuilder } from '@signalwire/sdk'; const builder = new ContextBuilder(); const ctx = builder.addContext('default'); ctx.addStep('greet').setText('Hello!'); try { builder.validate(); } catch (e) { console.log(`Invalid context config: ${e}`); } ``` > Validate the entire context configuration tree.