***

title: get_session
slug: /reference/python/agents/mcp-gateway/session-manager/get-session
description: Retrieve an active session by ID.
max-toc-depth: 3
---------------------

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

[session]: /docs/server-sdks/reference/python/agents/mcp-gateway/session-manager

Retrieve an active session by ID. Returns `None` if the session does not exist,
has expired, or if its underlying process has died. Automatically calls
`touch()` on the session to reset its expiration timer.

## **Parameters**

<ParamField path="session_id" type="str" required={true} toc={true}>
  The session ID to look up.
</ParamField>

## **Returns**

[`Session`][session] or `None`

## **Example**

```python {4}
from signalwire.mcp_gateway import SessionManager

manager = SessionManager(config)
session = manager.get_session("call-abc-123")
if session:
    print(f"Session active for service: {session.service_name}")
else:
    print("Session not found or expired")
```