# find_reauth_required

> **Function** in `deepagents_cli`

📖 [View in docs](https://reference.langchain.com/python/deepagents-cli/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/64d45f67c86edb4df2ced0e7b82f1a8fd158ec8c/libs/cli/deepagents_cli/mcp_auth.py#L589)