# format_policy_error_notice

> **Function** in `deepagents_code`

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

Build the CLI-style hint for an unreadable user trust policy.

Surfaced by `dcode mcp login` so a `config.toml` read failure is never
swallowed just because a user-level config or an env-enabled server still
loaded — and so the reason is not misattributed to an "untrusted project"
when the real fix is repairing `config.toml`.

## Signature

```python
format_policy_error_notice(
    policy_error: str | None,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `policy_error` | `str \| None` | Yes | The read-failure reason, or `None` when the policy loaded. |

## Returns

`str`

A single-line user-facing string. Empty when `policy_error` is `None`.

---

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