# find_reauth_required

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/mcp_auth/find_reauth_required)

Find an `MCPReauthRequiredError` anywhere inside `exc`'s tree.

Walks `exceptions` (for `ExceptionGroup`), then `__cause__` and
`__context__`, tracking visited nodes to terminate on cyclic chains.

## Signature

```python
find_reauth_required(
    exc: BaseException,
) -> MCPReauthRequiredError | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `exc` | `BaseException` | Yes | Root exception to inspect. |

## Returns

`MCPReauthRequiredError | None`

The nested `MCPReauthRequiredError`, or `None` if not present.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/d1c6946218b4f0f86ab7b02b6bb6af1e4b75cede/libs/code/deepagents_code/mcp_auth.py#L1483)