Table of Contents

Class CancelledNotification

Namespace
ModelContextProtocol.Protocol.Messages
Assembly
ModelContextProtocol.dll

Represents a notification indicating that a request has been cancelled by the client, and that any associated processing should cease immediately.

public sealed class CancelledNotification
Inheritance
CancelledNotification
Inherited Members

Remarks

This class is typically used in conjunction with the CancelledNotification method identifier. When a client sends this notification, the server should attempt to cancel any ongoing operations associated with the specified request ID.

Properties

Reason

Gets or sets an optional string describing the reason for the cancellation request.

[JsonPropertyName("reason")]
public string? Reason { get; set; }

Property Value

string

RequestId

Gets or sets the ID of the request to cancel.

[JsonPropertyName("requestId")]
public RequestId RequestId { get; set; }

Property Value

RequestId

Remarks

This must match the ID of an in-flight request that the sender wishes to cancel.