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

# reset

> Remove all contexts, returning the builder to its initial state.

[ref-context-builder]: /docs/server-sdks/reference/typescript/agents/context-builder

Remove all contexts, returning the builder to its initial state. Use this
inside a dynamic-config callback when you need to rebuild contexts from
scratch for a specific request, rather than mutating the shared builder.

## **Returns**

[`ContextBuilder`][ref-context-builder] — self for method chaining.

## **Example**

```typescript {3}
agent.setDynamicConfigCallback((queryParams, bodyParams, headers, ephemeralAgent) => {
  if (queryParams['tenant'] === 'billing') {
    const builder = (ephemeralAgent as any).defineContexts();
    builder.reset();
    builder.addContext('default')
      .addStep('greeting')
      .setText('Welcome to billing.');
  }
});
```