@@ -270,7 +270,7 @@ where t.GetCustomAttribute<McpServerPromptTypeAttribute>() is not null
270
270
/// resource system where templates define the URI patterns and the read handler provides the actual content.
271
271
/// </para>
272
272
/// </remarks>
273
- public static IMcpServerBuilder WithListResourceTemplatesHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListResourceTemplatesRequestParams > , CancellationToken , Task < ListResourceTemplatesResult > > handler )
273
+ public static IMcpServerBuilder WithListResourceTemplatesHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListResourceTemplatesRequestParams > , CancellationToken , ValueTask < ListResourceTemplatesResult > > handler )
274
274
{
275
275
Throw . IfNull ( builder ) ;
276
276
@@ -303,7 +303,7 @@ public static IMcpServerBuilder WithListResourceTemplatesHandler(this IMcpServer
303
303
/// executes them when invoked by clients.
304
304
/// </para>
305
305
/// </remarks>
306
- public static IMcpServerBuilder WithListToolsHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListToolsRequestParams > , CancellationToken , Task < ListToolsResult > > handler )
306
+ public static IMcpServerBuilder WithListToolsHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListToolsRequestParams > , CancellationToken , ValueTask < ListToolsResult > > handler )
307
307
{
308
308
Throw . IfNull ( builder ) ;
309
309
@@ -323,7 +323,7 @@ public static IMcpServerBuilder WithListToolsHandler(this IMcpServerBuilder buil
323
323
/// This method is typically paired with <see cref="WithListToolsHandler"/> to provide a complete tools implementation,
324
324
/// where <see cref="WithListToolsHandler"/> advertises available tools and this handler executes them.
325
325
/// </remarks>
326
- public static IMcpServerBuilder WithCallToolHandler ( this IMcpServerBuilder builder , Func < RequestContext < CallToolRequestParams > , CancellationToken , Task < CallToolResponse > > handler )
326
+ public static IMcpServerBuilder WithCallToolHandler ( this IMcpServerBuilder builder , Func < RequestContext < CallToolRequestParams > , CancellationToken , ValueTask < CallToolResponse > > handler )
327
327
{
328
328
Throw . IfNull ( builder ) ;
329
329
@@ -356,7 +356,7 @@ public static IMcpServerBuilder WithCallToolHandler(this IMcpServerBuilder build
356
356
/// produces them when invoked by clients.
357
357
/// </para>
358
358
/// </remarks>
359
- public static IMcpServerBuilder WithListPromptsHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListPromptsRequestParams > , CancellationToken , Task < ListPromptsResult > > handler )
359
+ public static IMcpServerBuilder WithListPromptsHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListPromptsRequestParams > , CancellationToken , ValueTask < ListPromptsResult > > handler )
360
360
{
361
361
Throw . IfNull ( builder ) ;
362
362
@@ -371,7 +371,7 @@ public static IMcpServerBuilder WithListPromptsHandler(this IMcpServerBuilder bu
371
371
/// <param name="handler">The handler function that processes prompt requests.</param>
372
372
/// <returns>The builder provided in <paramref name="builder"/>.</returns>
373
373
/// <exception cref="ArgumentNullException"><paramref name="builder"/> is <see langword="null"/>.</exception>
374
- public static IMcpServerBuilder WithGetPromptHandler ( this IMcpServerBuilder builder , Func < RequestContext < GetPromptRequestParams > , CancellationToken , Task < GetPromptResult > > handler )
374
+ public static IMcpServerBuilder WithGetPromptHandler ( this IMcpServerBuilder builder , Func < RequestContext < GetPromptRequestParams > , CancellationToken , ValueTask < GetPromptResult > > handler )
375
375
{
376
376
Throw . IfNull ( builder ) ;
377
377
@@ -392,7 +392,7 @@ public static IMcpServerBuilder WithGetPromptHandler(this IMcpServerBuilder buil
392
392
/// where this handler advertises available resources and the read handler provides their content when requested.
393
393
/// </para>
394
394
/// </remarks>
395
- public static IMcpServerBuilder WithListResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListResourcesRequestParams > , CancellationToken , Task < ListResourcesResult > > handler )
395
+ public static IMcpServerBuilder WithListResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < ListResourcesRequestParams > , CancellationToken , ValueTask < ListResourcesResult > > handler )
396
396
{
397
397
Throw . IfNull ( builder ) ;
398
398
@@ -411,7 +411,7 @@ public static IMcpServerBuilder WithListResourcesHandler(this IMcpServerBuilder
411
411
/// This handler is typically paired with <see cref="WithListResourcesHandler"/> to provide a complete resources implementation,
412
412
/// where the list handler advertises available resources and the read handler provides their content when requested.
413
413
/// </remarks>
414
- public static IMcpServerBuilder WithReadResourceHandler ( this IMcpServerBuilder builder , Func < RequestContext < ReadResourceRequestParams > , CancellationToken , Task < ReadResourceResult > > handler )
414
+ public static IMcpServerBuilder WithReadResourceHandler ( this IMcpServerBuilder builder , Func < RequestContext < ReadResourceRequestParams > , CancellationToken , ValueTask < ReadResourceResult > > handler )
415
415
{
416
416
Throw . IfNull ( builder ) ;
417
417
@@ -430,7 +430,7 @@ public static IMcpServerBuilder WithReadResourceHandler(this IMcpServerBuilder b
430
430
/// The completion handler is invoked when clients request suggestions for argument values.
431
431
/// This enables auto-complete functionality for both prompt arguments and resource references.
432
432
/// </remarks>
433
- public static IMcpServerBuilder WithCompleteHandler ( this IMcpServerBuilder builder , Func < RequestContext < CompleteRequestParams > , CancellationToken , Task < CompleteResult > > handler )
433
+ public static IMcpServerBuilder WithCompleteHandler ( this IMcpServerBuilder builder , Func < RequestContext < CompleteRequestParams > , CancellationToken , ValueTask < CompleteResult > > handler )
434
434
{
435
435
Throw . IfNull ( builder ) ;
436
436
@@ -460,7 +460,7 @@ public static IMcpServerBuilder WithCompleteHandler(this IMcpServerBuilder build
460
460
/// resources and to send appropriate notifications through the connection when resources change.
461
461
/// </para>
462
462
/// </remarks>
463
- public static IMcpServerBuilder WithSubscribeToResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < SubscribeRequestParams > , CancellationToken , Task < EmptyResult > > handler )
463
+ public static IMcpServerBuilder WithSubscribeToResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < SubscribeRequestParams > , CancellationToken , ValueTask < EmptyResult > > handler )
464
464
{
465
465
Throw . IfNull ( builder ) ;
466
466
@@ -490,7 +490,7 @@ public static IMcpServerBuilder WithSubscribeToResourcesHandler(this IMcpServerB
490
490
/// to the specified resource.
491
491
/// </para>
492
492
/// </remarks>
493
- public static IMcpServerBuilder WithUnsubscribeFromResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < UnsubscribeRequestParams > , CancellationToken , Task < EmptyResult > > handler )
493
+ public static IMcpServerBuilder WithUnsubscribeFromResourcesHandler ( this IMcpServerBuilder builder , Func < RequestContext < UnsubscribeRequestParams > , CancellationToken , ValueTask < EmptyResult > > handler )
494
494
{
495
495
Throw . IfNull ( builder ) ;
496
496
@@ -517,7 +517,7 @@ public static IMcpServerBuilder WithUnsubscribeFromResourcesHandler(this IMcpSer
517
517
/// most recently set level.
518
518
/// </para>
519
519
/// </remarks>
520
- public static IMcpServerBuilder WithSetLoggingLevelHandler ( this IMcpServerBuilder builder , Func < RequestContext < SetLevelRequestParams > , CancellationToken , Task < EmptyResult > > handler )
520
+ public static IMcpServerBuilder WithSetLoggingLevelHandler ( this IMcpServerBuilder builder , Func < RequestContext < SetLevelRequestParams > , CancellationToken , ValueTask < EmptyResult > > handler )
521
521
{
522
522
Throw . IfNull ( builder ) ;
523
523
0 commit comments