Implement cancellation notifications (#146)
* Implement cancellation notifications * Address PR feedback * Address feedback
This commit is contained in:
parent
5d3fb65b11
commit
8fe96bf6ba
1 changed files with 201 additions and 43 deletions
|
|
@ -0,0 +1,21 @@
|
|||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModelContextProtocol.Protocol.Messages;
|
||||
|
||||
/// <summary>
|
||||
/// This notification indicates that the result will be unused, so any associated processing SHOULD cease.
|
||||
/// </summary>
|
||||
public sealed class CancelledNotification
|
||||
{
|
||||
/// <summary>
|
||||
/// The ID of the request to cancel.
|
||||
/// </summary>
|
||||
[JsonPropertyName("requestId")]
|
||||
public RequestId RequestId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An optional string describing the reason for the cancellation.
|
||||
/// </summary>
|
||||
[JsonPropertyName("reason")]
|
||||
public string? Reason { get; set; }
|
||||
}
|
||||
Loading…
Reference in a new issue