@@ -28,4 +28,110 @@ public sealed class ResourcesCapability
2828 /// </remarks>
2929 [ JsonPropertyName ( "listChanged" ) ]
3030 public bool ? ListChanged { get ; set ; }
31+
32+ /// <summary>
33+ /// Gets or sets the handler for <see cref="RequestMethods.ResourcesTemplatesList"/> requests.
34+ /// </summary>
35+ /// <remarks>
36+ /// This handler is called when clients request available resource templates that can be used
37+ /// to create resources within the Model Context Protocol server.
38+ /// Resource templates define the structure and URI patterns for resources accessible in the system,
39+ /// allowing clients to discover available resource types and their access patterns.
40+ /// </remarks>
41+ [ JsonIgnore ]
42+ [ Obsolete ( $ "Use { nameof ( McpServerHandlers . ListResourceTemplatesHandler ) } instead.") ]
43+ public McpRequestHandler < ListResourceTemplatesRequestParams , ListResourceTemplatesResult > ? ListResourceTemplatesHandler
44+ {
45+ get => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . ListResourceTemplatesHandler ) } instead.") ;
46+ set => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . ListResourceTemplatesHandler ) } instead.") ;
47+ }
48+
49+ /// <summary>
50+ /// Gets or sets the handler for <see cref="RequestMethods.ResourcesList"/> requests.
51+ /// </summary>
52+ /// <remarks>
53+ /// This handler responds to client requests for available resources and returns information about resources accessible through the server.
54+ /// The implementation should return a <see cref="ListResourcesResult"/> with the matching resources.
55+ /// </remarks>
56+ [ JsonIgnore ]
57+ [ Obsolete ( $ "Use { nameof ( McpServerHandlers . ListResourcesHandler ) } instead.") ]
58+ public McpRequestHandler < ListResourcesRequestParams , ListResourcesResult > ? ListResourcesHandler
59+ {
60+ get => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . ListResourcesHandler ) } instead.") ;
61+ set => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . ListResourcesHandler ) } instead.") ;
62+ }
63+
64+ /// <summary>
65+ /// Gets or sets the handler for <see cref="RequestMethods.ResourcesRead"/> requests.
66+ /// </summary>
67+ /// <remarks>
68+ /// This handler is responsible for retrieving the content of a specific resource identified by its URI in the Model Context Protocol.
69+ /// When a client sends a resources/read request, this handler is invoked with the resource URI.
70+ /// The handler should implement logic to locate and retrieve the requested resource, then return
71+ /// its contents in a ReadResourceResult object.
72+ /// </remarks>
73+ [ JsonIgnore ]
74+ [ Obsolete ( $ "Use { nameof ( McpServerHandlers . ReadResourceHandler ) } instead.") ]
75+ public McpRequestHandler < ReadResourceRequestParams , ReadResourceResult > ? ReadResourceHandler
76+ {
77+ get => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . ReadResourceHandler ) } instead.") ;
78+ set => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . ReadResourceHandler ) } instead.") ;
79+ }
80+
81+ /// <summary>
82+ /// Gets or sets the handler for <see cref="RequestMethods.ResourcesSubscribe"/> requests.
83+ /// </summary>
84+ /// <remarks>
85+ /// When a client sends a <see cref="RequestMethods.ResourcesSubscribe"/> request, this handler is invoked with the resource URI
86+ /// to be subscribed to. The implementation should register the client's interest in receiving updates
87+ /// for the specified resource.
88+ /// Subscriptions allow clients to receive real-time notifications when resources change, without
89+ /// requiring polling.
90+ /// </remarks>
91+ [ JsonIgnore ]
92+ [ Obsolete ( $ "Use { nameof ( McpServerHandlers . SubscribeToResourcesHandler ) } instead.") ]
93+ public McpRequestHandler < SubscribeRequestParams , EmptyResult > ? SubscribeToResourcesHandler
94+ {
95+ get => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . SubscribeToResourcesHandler ) } instead.") ;
96+ set => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . SubscribeToResourcesHandler ) } instead.") ;
97+ }
98+
99+ /// <summary>
100+ /// Gets or sets the handler for <see cref="RequestMethods.ResourcesUnsubscribe"/> requests.
101+ /// </summary>
102+ /// <remarks>
103+ /// When a client sends a <see cref="RequestMethods.ResourcesUnsubscribe"/> request, this handler is invoked with the resource URI
104+ /// to be unsubscribed from. The implementation should remove the client's registration for receiving updates
105+ /// about the specified resource.
106+ /// </remarks>
107+ [ JsonIgnore ]
108+ [ Obsolete ( $ "Use { nameof ( McpServerHandlers . UnsubscribeFromResourcesHandler ) } instead.") ]
109+ public McpRequestHandler < UnsubscribeRequestParams , EmptyResult > ? UnsubscribeFromResourcesHandler
110+ {
111+ get => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . UnsubscribeFromResourcesHandler ) } instead.") ;
112+ set => throw new NotSupportedException ( $ "Use { nameof ( McpServerHandlers . UnsubscribeFromResourcesHandler ) } instead.") ;
113+ }
114+
115+ /// <summary>
116+ /// Gets or sets a collection of resources served by the server.
117+ /// </summary>
118+ /// <remarks>
119+ /// <para>
120+ /// Resources specified via <see cref="ResourceCollection"/> augment the <see cref="ListResourcesHandler"/>, <see cref="ListResourceTemplatesHandler"/>
121+ /// and <see cref="ReadResourceHandler"/> handlers, if provided. Resources with template expressions in their URI templates are considered resource templates
122+ /// and are listed via ListResourceTemplate, whereas resources without template parameters are considered static resources and are listed with ListResources.
123+ /// </para>
124+ /// <para>
125+ /// ReadResource requests will first check the <see cref="ResourceCollection"/> for the exact resource being requested. If no match is found, they'll proceed to
126+ /// try to match the resource against each resource template in <see cref="ResourceCollection"/>. If no match is still found, the request will fall back to
127+ /// any handler registered for <see cref="ReadResourceHandler"/>.
128+ /// </para>
129+ /// </remarks>
130+ [ JsonIgnore ]
131+ [ Obsolete ( $ "Use { nameof ( McpServerOptions . ResourceCollection ) } instead.") ]
132+ public McpServerResourceCollection ? ResourceCollection
133+ {
134+ get => throw new NotSupportedException ( $ "Use { nameof ( McpServerOptions . ResourceCollection ) } instead.") ;
135+ set => throw new NotSupportedException ( $ "Use { nameof ( McpServerOptions . ResourceCollection ) } instead.") ;
136+ }
31137}
0 commit comments