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

# getContext

> Retrieve an existing context by name.

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

Retrieve an existing context by name for inspection or modification.

## **Parameters**

**`name`** `string` — required

Name of the context to retrieve.

---

## **Returns**

[`Context`][context] if found,
`undefined` otherwise.

## **Example**

```typescript {7}
import { ContextBuilder } from '@signalwire/sdk';

const builder = new ContextBuilder();
const ctx = builder.addContext('default');
ctx.addStep('greet').setText('Greet the caller.');

const retrieved = builder.getContext('default');
if (retrieved !== undefined) {
  retrieved.addStep('followup').setText('Ask if there is anything else.');
}
```