***

title: close_session
slug: /reference/python/agents/mcp-gateway/session-manager/close-session
description: Close and remove a session.
max-toc-depth: 3
---------------------

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

Close and remove a session. Stops the underlying MCP client process. Returns
`True` if the session was found and closed, `False` if the session did not
exist.

## **Parameters**

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

## **Returns**

`bool` -- `True` if the session was found and closed, `False` otherwise.

## **Example**

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

manager = SessionManager(config)
closed = manager.close_session("call-abc-123")
if closed:
    print("Session closed successfully")
else:
    print("Session not found")
```