***

title: get_context
slug: /reference/python/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/python/agents/context-builder/context

Retrieve an existing context by name for inspection or modification.

## **Parameters**

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

## **Returns**

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

## **Example**

```python {9}
from signalwire import AgentBase

agent = AgentBase(name="my-agent", route="/agent")

contexts = agent.define_contexts()
default = contexts.add_context("default")
default.add_step("greet").set_text("Greet the caller.")

ctx = contexts.get_context("default")
if ctx is not None:
    ctx.add_step("followup").set_text("Ask if there is anything else.")

agent.serve()
```