@@ -275,7 +275,7 @@ where t.GetCustomAttribute<McpServerPromptTypeAttribute>() is not null
275275 /// resource system where templates define the URI patterns and the read handler provides the actual content.
276276 /// </para>
277277 /// </remarks>
278- public static IMcpServerBuilder WithListResourceTemplatesHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListResourceTemplatesRequestParams > , CancellationToken , Task < ListResourceTemplatesResult > > handler )
278+ public static IMcpServerBuilder WithListResourceTemplatesHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListResourceTemplatesRequestParams > , CancellationToken , ValueTask < ListResourceTemplatesResult > > handler )
279279 {
280280 Throw . IfNull ( builder ) ;
281281
@@ -308,7 +308,7 @@ public static IMcpServerBuilder WithListResourceTemplatesHandler(this IMcpServer
308308 /// executes them when invoked by clients.
309309 /// </para>
310310 /// </remarks>
311- public static IMcpServerBuilder WithListToolsHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListToolsRequestParams > , CancellationToken , Task < ListToolsResult > > handler )
311+ public static IMcpServerBuilder WithListToolsHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListToolsRequestParams > , CancellationToken , ValueTask < ListToolsResult > > handler )
312312 {
313313 Throw . IfNull ( builder ) ;
314314
@@ -328,7 +328,7 @@ public static IMcpServerBuilder WithListToolsHandler(this IMcpServerBuilder buil
328328 /// This method is typically paired with <see cref="WithListToolsHandler"/> to provide a complete tools implementation,
329329 /// where <see cref="WithListToolsHandler"/> advertises available tools and this handler executes them.
330330 /// </remarks>
331- public static IMcpServerBuilder WithCallToolHandler ( this IMcpServerBuilder builder , Func < RequestContext < CallToolRequestParams > , CancellationToken , Task < CallToolResponse > > handler )
331+ public static IMcpServerBuilder WithCallToolHandler ( this IMcpServerBuilder builder , Func < RequestContext < CallToolRequestParams > , CancellationToken , ValueTask < CallToolResponse > > handler )
332332 {
333333 Throw . IfNull ( builder ) ;
334334
@@ -361,7 +361,7 @@ public static IMcpServerBuilder WithCallToolHandler(this IMcpServerBuilder build
361361 /// produces them when invoked by clients.
362362 /// </para>
363363 /// </remarks>
364- public static IMcpServerBuilder WithListPromptsHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListPromptsRequestParams > , CancellationToken , Task < ListPromptsResult > > handler )
364+ public static IMcpServerBuilder WithListPromptsHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListPromptsRequestParams > , CancellationToken , ValueTask < ListPromptsResult > > handler )
365365 {
366366 Throw . IfNull ( builder ) ;
367367
@@ -376,7 +376,7 @@ public static IMcpServerBuilder WithListPromptsHandler(this IMcpServerBuilder bu
376376 /// <param name="handler">The handler function that processes prompt requests.</param>
377377 /// <returns>The builder provided in <paramref name="builder"/>.</returns>
378378 /// <exception cref="ArgumentNullException"><paramref name="builder"/> is <see langword="null"/>.</exception>
379- public static IMcpServerBuilder WithGetPromptHandler ( this IMcpServerBuilder builder , Func < RequestContext < GetPromptRequestParams > , CancellationToken , Task < GetPromptResult > > handler )
379+ public static IMcpServerBuilder WithGetPromptHandler ( this IMcpServerBuilder builder , Func < RequestContext < GetPromptRequestParams > , CancellationToken , ValueTask < GetPromptResult > > handler )
380380 {
381381 Throw . IfNull ( builder ) ;
382382
@@ -397,7 +397,7 @@ public static IMcpServerBuilder WithGetPromptHandler(this IMcpServerBuilder buil
397397 /// where this handler advertises available resources and the read handler provides their content when requested.
398398 /// </para>
399399 /// </remarks>
400- public static IMcpServerBuilder WithListResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListResourcesRequestParams > , CancellationToken , Task < ListResourcesResult > > handler )
400+ public static IMcpServerBuilder WithListResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListResourcesRequestParams > , CancellationToken , ValueTask < ListResourcesResult > > handler )
401401 {
402402 Throw . IfNull ( builder ) ;
403403
@@ -416,7 +416,7 @@ public static IMcpServerBuilder WithListResourcesHandler(this IMcpServerBuilder
416416 /// This handler is typically paired with <see cref="WithListResourcesHandler"/> to provide a complete resources implementation,
417417 /// where the list handler advertises available resources and the read handler provides their content when requested.
418418 /// </remarks>
419- public static IMcpServerBuilder WithReadResourceHandler ( this IMcpServerBuilder builder , Func < RequestContext < ReadResourceRequestParams > , CancellationToken , Task < ReadResourceResult > > handler )
419+ public static IMcpServerBuilder WithReadResourceHandler ( this IMcpServerBuilder builder , Func < RequestContext < ReadResourceRequestParams > , CancellationToken , ValueTask < ReadResourceResult > > handler )
420420 {
421421 Throw . IfNull ( builder ) ;
422422
@@ -435,7 +435,7 @@ public static IMcpServerBuilder WithReadResourceHandler(this IMcpServerBuilder b
435435 /// The completion handler is invoked when clients request suggestions for argument values.
436436 /// This enables auto-complete functionality for both prompt arguments and resource references.
437437 /// </remarks>
438- public static IMcpServerBuilder WithCompleteHandler ( this IMcpServerBuilder builder , Func < RequestContext < CompleteRequestParams > , CancellationToken , Task < CompleteResult > > handler )
438+ public static IMcpServerBuilder WithCompleteHandler ( this IMcpServerBuilder builder , Func < RequestContext < CompleteRequestParams > , CancellationToken , ValueTask < CompleteResult > > handler )
439439 {
440440 Throw . IfNull ( builder ) ;
441441
@@ -465,7 +465,7 @@ public static IMcpServerBuilder WithCompleteHandler(this IMcpServerBuilder build
465465 /// resources and to send appropriate notifications through the connection when resources change.
466466 /// </para>
467467 /// </remarks>
468- public static IMcpServerBuilder WithSubscribeToResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < SubscribeRequestParams > , CancellationToken , Task < EmptyResult > > handler )
468+ public static IMcpServerBuilder WithSubscribeToResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < SubscribeRequestParams > , CancellationToken , ValueTask < EmptyResult > > handler )
469469 {
470470 Throw . IfNull ( builder ) ;
471471
@@ -495,7 +495,7 @@ public static IMcpServerBuilder WithSubscribeToResourcesHandler(this IMcpServerB
495495 /// to the specified resource.
496496 /// </para>
497497 /// </remarks>
498- public static IMcpServerBuilder WithUnsubscribeFromResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < UnsubscribeRequestParams > , CancellationToken , Task < EmptyResult > > handler )
498+ public static IMcpServerBuilder WithUnsubscribeFromResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < UnsubscribeRequestParams > , CancellationToken , ValueTask < EmptyResult > > handler )
499499 {
500500 Throw . IfNull ( builder ) ;
501501
@@ -522,7 +522,7 @@ public static IMcpServerBuilder WithUnsubscribeFromResourcesHandler(this IMcpSer
522522 /// most recently set level.
523523 /// </para>
524524 /// </remarks>
525- public static IMcpServerBuilder WithSetLoggingLevelHandler ( this IMcpServerBuilder builder , Func < RequestContext < SetLevelRequestParams > , CancellationToken , Task < EmptyResult > > handler )
525+ public static IMcpServerBuilder WithSetLoggingLevelHandler ( this IMcpServerBuilder builder , Func < RequestContext < SetLevelRequestParams > , CancellationToken , ValueTask < EmptyResult > > handler )
526526 {
527527 Throw . IfNull ( builder ) ;
528528
0 commit comments