Table of Contents

Method CancelRequestAsync

Namespace
LMKit.Mcp.Client
Assembly
LM-Kit.NET.dll

CancelRequestAsync(long, string, CancellationToken)

Sends a cancellation notification to the server for an in-progress request. The server SHOULD stop processing the request, but this is not guaranteed.

public Task CancelRequestAsync(long requestId, string reason = null, CancellationToken cancellationToken = default)

Parameters

requestId long

The ID of the request to cancel.

reason string

An optional reason for the cancellation.

cancellationToken CancellationToken

A token to cancel this operation.

Returns

Task

Remarks

Note: The initialize request MUST NOT be cancelled. After sending a cancellation, the sender SHOULD ignore any response that arrives for the cancelled request.