# detect_approval_rejection

> **Function** in `langchain_azure_ai`

📖 [View in docs](https://reference.langchain.com/python/langchain-azure-ai/agents/hosting/_converters/_hitl/detect_approval_rejection)

Return a human-readable message if the client rejected an interrupt.

Scans for :class:`MCPApprovalResponse` items whose
``approval_request_id`` matches a pending interrupt and whose
``approve`` is ``False``. The first match wins; subsequent rejections
are ignored.

The host's :meth:`handle_create` calls this *before* attempting to
resume so a rejection short-circuits the turn into
``response.failed`` instead of being silently dropped.

## Signature

```python
detect_approval_rejection(
    items: Sequence[Any],
    pending: Sequence[Interrupt],
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `items` | `Sequence[Any]` | Yes | Resolved input items from the request. |
| `pending` | `Sequence[Interrupt]` | Yes | Pending interrupts on the graph's checkpointed state. |

## Returns

`str | None`

The rejection message (including the rejected interrupt id and

---

[View source on GitHub](https://github.com/langchain-ai/langchain-azure/blob/7a6a664d617264df8dcb12fcfb1bacc09f21d504/libs/azure-ai/langchain_azure_ai/agents/hosting/_converters/_hitl.py#L423)