@@ -275,7 +275,7 @@ where t.GetCustomAttribute<McpServerPromptTypeAttribute>() is not null
275
275
/// resource system where templates define the URI patterns and the read handler provides the actual content.
276
276
/// </para>
277
277
/// </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 )
279
279
{
280
280
Throw . IfNull ( builder ) ;
281
281
@@ -308,7 +308,7 @@ public static IMcpServerBuilder WithListResourceTemplatesHandler(this IMcpServer
308
308
/// executes them when invoked by clients.
309
309
/// </para>
310
310
/// </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 )
312
312
{
313
313
Throw . IfNull ( builder ) ;
314
314
@@ -328,7 +328,7 @@ public static IMcpServerBuilder WithListToolsHandler(this IMcpServerBuilder buil
328
328
/// This method is typically paired with <see cref="WithListToolsHandler"/> to provide a complete tools implementation,
329
329
/// where <see cref="WithListToolsHandler"/> advertises available tools and this handler executes them.
330
330
/// </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 )
332
332
{
333
333
Throw . IfNull ( builder ) ;
334
334
@@ -361,7 +361,7 @@ public static IMcpServerBuilder WithCallToolHandler(this IMcpServerBuilder build
361
361
/// produces them when invoked by clients.
362
362
/// </para>
363
363
/// </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 )
365
365
{
366
366
Throw . IfNull ( builder ) ;
367
367
@@ -376,7 +376,7 @@ public static IMcpServerBuilder WithListPromptsHandler(this IMcpServerBuilder bu
376
376
/// <param name="handler">The handler function that processes prompt requests.</param>
377
377
/// <returns>The builder provided in <paramref name="builder"/>.</returns>
378
378
/// <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 )
380
380
{
381
381
Throw . IfNull ( builder ) ;
382
382
@@ -397,7 +397,7 @@ public static IMcpServerBuilder WithGetPromptHandler(this IMcpServerBuilder buil
397
397
/// where this handler advertises available resources and the read handler provides their content when requested.
398
398
/// </para>
399
399
/// </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 )
401
401
{
402
402
Throw . IfNull ( builder ) ;
403
403
@@ -416,7 +416,7 @@ public static IMcpServerBuilder WithListResourcesHandler(this IMcpServerBuilder
416
416
/// This handler is typically paired with <see cref="WithListResourcesHandler"/> to provide a complete resources implementation,
417
417
/// where the list handler advertises available resources and the read handler provides their content when requested.
418
418
/// </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 )
420
420
{
421
421
Throw . IfNull ( builder ) ;
422
422
@@ -435,7 +435,7 @@ public static IMcpServerBuilder WithReadResourceHandler(this IMcpServerBuilder b
435
435
/// The completion handler is invoked when clients request suggestions for argument values.
436
436
/// This enables auto-complete functionality for both prompt arguments and resource references.
437
437
/// </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 )
439
439
{
440
440
Throw . IfNull ( builder ) ;
441
441
@@ -465,7 +465,7 @@ public static IMcpServerBuilder WithCompleteHandler(this IMcpServerBuilder build
465
465
/// resources and to send appropriate notifications through the connection when resources change.
466
466
/// </para>
467
467
/// </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 )
469
469
{
470
470
Throw . IfNull ( builder ) ;
471
471
@@ -495,7 +495,7 @@ public static IMcpServerBuilder WithSubscribeToResourcesHandler(this IMcpServerB
495
495
/// to the specified resource.
496
496
/// </para>
497
497
/// </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 )
499
499
{
500
500
Throw . IfNull ( builder ) ;
501
501
@@ -522,7 +522,7 @@ public static IMcpServerBuilder WithUnsubscribeFromResourcesHandler(this IMcpSer
522
522
/// most recently set level.
523
523
/// </para>
524
524
/// </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 )
526
526
{
527
527
Throw . IfNull ( builder ) ;
528
528
0 commit comments