***

title: getContext
slug: /reference/typescript/agents/context-builder/get-context
description: Retrieve an existing context by name.
max-toc-depth: 3
---------------------

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

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

Retrieve an existing context by name for inspection or modification.

## **Parameters**

<ParamField path="name" type="string" required={true} toc={true}>
  Name of the context to retrieve.
</ParamField>

## **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.');
}
```