forked from modelcontextprotocol/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubscribeRequestParams.cs
More file actions
33 lines (31 loc) · 1.22 KB
/
SubscribeRequestParams.cs
File metadata and controls
33 lines (31 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System.Text.Json.Serialization;
namespace ModelContextProtocol.Protocol;
/// <summary>
/// Represents the parameters used with a <see cref="RequestMethods.ResourcesSubscribe"/> request from a client
/// to request real-time notifications from the server whenever a particular resource changes.
/// </summary>
/// <remarks>
/// <para>
/// The subscription mechanism allows clients to be notified about changes to specific resources
/// identified by their URI. When a subscribed resource changes, the server sends a notification
/// to the client with the updated resource information.
/// </para>
/// <para>
/// Subscriptions remain active until explicitly canceled using <see cref="UnsubscribeRequestParams"/>
/// or until the connection is terminated.
/// </para>
/// <para>
/// The server may refuse or limit subscriptions based on its capabilities or resource constraints.
/// </para>
/// </remarks>
public class SubscribeRequestParams : RequestParams
{
/// <summary>
/// Gets or sets the URI of the resource to subscribe to.
/// </summary>
/// <remarks>
/// The URI can use any protocol; it is up to the server how to interpret it.
/// </remarks>
[JsonPropertyName("uri")]
public string? Uri { get; init; }
}