Interface IMcpApprovalHandler
Handles approval requests for MCP tool invocations that require human approval. Register this to ResponseAgent or other relevant components to process approval requests.
public interface IMcpApprovalHandler
Methods
HandleAsync(McpApprovalRequest, CancellationToken)
Handles an approval request for an MCP tool invocation.
UniTask<McpApprovalResponse> HandleAsync(McpApprovalRequest request, CancellationToken ct = default)
Parameters
requestMcpApprovalRequestThe approval request containing details about the tool invocation.
ctCancellationTokenA cancellation token to cancel the operation if needed.
Returns
- UniTask<McpApprovalResponse>
A task that resolves to an McpApprovalResponse indicating whether the tool invocation is approved or denied. Must return null if the request is not handled, causing the next handler to be tried.