# validate_approval_responses

> **Function** in `langchain_azure_ai`

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

Return a validation error when an approval shortcut cannot be applied.

Scans for :class:`MCPApprovalResponse` items whose
``approval_request_id`` matches a pending interrupt. Recognized LangChain
``HumanInTheLoopMiddleware`` requests are valid only when every action
allows the selected decision. For other interrupt payloads,
``approve=False`` returns an error instead of resuming the graph.

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
validate_approval_responses(
    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 validation error, or ``None`` when every approval response is valid.

---

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