@@ -126,8 +126,7 @@ public async Task Can_List_Registered_Tools()
126
126
var tools = await client . ListToolsAsync ( cancellationToken : TestContext . Current . CancellationToken ) ;
127
127
Assert . Equal ( 16 , tools . Count ) ;
128
128
129
- McpClientTool echoTool = tools . First ( t => t . Name == "Echo" ) ;
130
- Assert . Equal ( "Echo" , echoTool . Name ) ;
129
+ McpClientTool echoTool = tools . First ( t => t . Name == "echo" ) ;
131
130
Assert . Equal ( "Echoes the input back to the client." , echoTool . Description ) ;
132
131
Assert . Equal ( "object" , echoTool . JsonSchema . GetProperty ( "type" ) . GetString ( ) ) ;
133
132
Assert . Equal ( JsonValueKind . Object , echoTool . JsonSchema . GetProperty ( "properties" ) . GetProperty ( "message" ) . ValueKind ) ;
@@ -165,8 +164,7 @@ public async Task Can_Create_Multiple_Servers_From_Options_And_List_Registered_T
165
164
var tools = await client . ListToolsAsync ( cancellationToken : TestContext . Current . CancellationToken ) ;
166
165
Assert . Equal ( 16 , tools . Count ) ;
167
166
168
- McpClientTool echoTool = tools . First ( t => t . Name == "Echo" ) ;
169
- Assert . Equal ( "Echo" , echoTool . Name ) ;
167
+ McpClientTool echoTool = tools . First ( t => t . Name == "echo" ) ;
170
168
Assert . Equal ( "Echoes the input back to the client." , echoTool . Description ) ;
171
169
Assert . Equal ( "object" , echoTool . JsonSchema . GetProperty ( "type" ) . GetString ( ) ) ;
172
170
Assert . Equal ( JsonValueKind . Object , echoTool . JsonSchema . GetProperty ( "properties" ) . GetProperty ( "message" ) . ValueKind ) ;
@@ -231,7 +229,7 @@ public async Task Can_Call_Registered_Tool()
231
229
await using IMcpClient client = await CreateMcpClientForServer ( ) ;
232
230
233
231
var result = await client . CallToolAsync (
234
- "Echo " ,
232
+ "echo " ,
235
233
new Dictionary < string , object ? > ( ) { [ "message" ] = "Peter" } ,
236
234
cancellationToken : TestContext . Current . CancellationToken ) ;
237
235
@@ -250,7 +248,7 @@ public async Task Can_Call_Registered_Tool_With_Array_Result()
250
248
await using IMcpClient client = await CreateMcpClientForServer ( ) ;
251
249
252
250
var result = await client . CallToolAsync (
253
- "EchoArray " ,
251
+ "echo_array " ,
254
252
new Dictionary < string , object ? > ( ) { [ "message" ] = "Peter" } ,
255
253
cancellationToken : TestContext . Current . CancellationToken ) ;
256
254
@@ -274,7 +272,7 @@ public async Task Can_Call_Registered_Tool_With_Null_Result()
274
272
await using IMcpClient client = await CreateMcpClientForServer ( ) ;
275
273
276
274
var result = await client . CallToolAsync (
277
- "ReturnNull " ,
275
+ "return_null " ,
278
276
cancellationToken : TestContext . Current . CancellationToken ) ;
279
277
280
278
Assert . NotNull ( result ) ;
@@ -288,7 +286,7 @@ public async Task Can_Call_Registered_Tool_With_Json_Result()
288
286
await using IMcpClient client = await CreateMcpClientForServer ( ) ;
289
287
290
288
var result = await client . CallToolAsync (
291
- "ReturnJson " ,
289
+ "return_json " ,
292
290
cancellationToken : TestContext . Current . CancellationToken ) ;
293
291
294
292
Assert . NotNull ( result ) ;
@@ -305,7 +303,7 @@ public async Task Can_Call_Registered_Tool_With_Int_Result()
305
303
await using IMcpClient client = await CreateMcpClientForServer ( ) ;
306
304
307
305
var result = await client . CallToolAsync (
308
- "ReturnInteger " ,
306
+ "return_integer " ,
309
307
cancellationToken : TestContext . Current . CancellationToken ) ;
310
308
311
309
Assert . NotNull ( result . Content ) ;
@@ -320,7 +318,7 @@ public async Task Can_Call_Registered_Tool_And_Pass_ComplexType()
320
318
await using IMcpClient client = await CreateMcpClientForServer ( ) ;
321
319
322
320
var result = await client . CallToolAsync (
323
- "EchoComplex " ,
321
+ "echo_complex " ,
324
322
new Dictionary < string , object ? > ( ) { [ "complex" ] = JsonDocument . Parse ( """{"Name": "Peter", "Age": 25}""" ) . RootElement } ,
325
323
cancellationToken : TestContext . Current . CancellationToken ) ;
326
324
@@ -340,7 +338,7 @@ public async Task Can_Call_Registered_Tool_With_Instance_Method()
340
338
for ( int i = 0 ; i < 2 ; i ++ )
341
339
{
342
340
var result = await client . CallToolAsync (
343
- nameof ( EchoTool . GetCtorParameter ) ,
341
+ "get_ctor_parameter" ,
344
342
cancellationToken : TestContext . Current . CancellationToken ) ;
345
343
346
344
Assert . NotNull ( result ) ;
@@ -366,7 +364,7 @@ public async Task Returns_IsError_Content_When_Tool_Fails()
366
364
await using IMcpClient client = await CreateMcpClientForServer ( ) ;
367
365
368
366
var result = await client . CallToolAsync (
369
- "ThrowException " ,
367
+ "throw_exception " ,
370
368
cancellationToken : TestContext . Current . CancellationToken ) ;
371
369
372
370
Assert . True ( result . IsError ) ;
@@ -393,7 +391,7 @@ public async Task Returns_IsError_Missing_Parameter()
393
391
await using IMcpClient client = await CreateMcpClientForServer ( ) ;
394
392
395
393
var result = await client . CallToolAsync (
396
- "Echo " ,
394
+ "echo " ,
397
395
cancellationToken : TestContext . Current . CancellationToken ) ;
398
396
399
397
Assert . True ( result . IsError ) ;
@@ -436,7 +434,7 @@ public void Register_Tools_From_Current_Assembly()
436
434
sc . AddMcpServer ( ) . WithToolsFromAssembly ( ) ;
437
435
IServiceProvider services = sc . BuildServiceProvider ( ) ;
438
436
439
- Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "Echo " ) ;
437
+ Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "echo " ) ;
440
438
}
441
439
442
440
[ Theory ]
@@ -452,7 +450,7 @@ public void WithTools_Parameters_Satisfiable_From_DI(bool parameterInServices)
452
450
sc . AddMcpServer ( ) . WithTools ( [ typeof ( EchoTool ) ] , BuilderToolsJsonContext . Default . Options ) ;
453
451
IServiceProvider services = sc . BuildServiceProvider ( ) ;
454
452
455
- McpServerTool tool = services . GetServices < McpServerTool > ( ) . First ( t => t . ProtocolTool . Name == "EchoComplex " ) ;
453
+ McpServerTool tool = services . GetServices < McpServerTool > ( ) . First ( t => t . ProtocolTool . Name == "echo_complex " ) ;
456
454
if ( parameterInServices )
457
455
{
458
456
Assert . DoesNotContain ( "\" complex\" " , JsonSerializer . Serialize ( tool . ProtocolTool . InputSchema , AIJsonUtilities . DefaultOptions ) ) ;
@@ -495,7 +493,7 @@ public void WithToolsFromAssembly_Parameters_Satisfiable_From_DI(ServiceLifetime
495
493
sc . AddMcpServer ( ) . WithToolsFromAssembly ( ) ;
496
494
IServiceProvider services = sc . BuildServiceProvider ( ) ;
497
495
498
- McpServerTool tool = services . GetServices < McpServerTool > ( ) . First ( t => t . ProtocolTool . Name == "EchoComplex " ) ;
496
+ McpServerTool tool = services . GetServices < McpServerTool > ( ) . First ( t => t . ProtocolTool . Name == "echo_complex " ) ;
499
497
if ( lifetime is not null )
500
498
{
501
499
Assert . DoesNotContain ( "\" complex\" " , JsonSerializer . Serialize ( tool . ProtocolTool . InputSchema , AIJsonUtilities . DefaultOptions ) ) ;
@@ -516,8 +514,7 @@ public async Task Recognizes_Parameter_Types()
516
514
Assert . NotNull ( tools ) ;
517
515
Assert . NotEmpty ( tools ) ;
518
516
519
- var tool = tools . First ( t => t . Name == "TestTool" ) ;
520
- Assert . Equal ( "TestTool" , tool . Name ) ;
517
+ var tool = tools . First ( t => t . Name == "test_tool" ) ;
521
518
Assert . Empty ( tool . Description ! ) ;
522
519
Assert . Equal ( "object" , tool . JsonSchema . GetProperty ( "type" ) . GetString ( ) ) ;
523
520
@@ -543,9 +540,9 @@ public void Register_Tools_From_Multiple_Sources()
543
540
544
541
Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "double_echo" ) ;
545
542
Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "DifferentName" ) ;
546
- Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "MethodB " ) ;
547
- Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "MethodC " ) ;
548
- Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "MethodD " ) ;
543
+ Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "method_b " ) ;
544
+ Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "method_c " ) ;
545
+ Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "method_d " ) ;
549
546
Assert . Contains ( services . GetServices < McpServerTool > ( ) , t => t . ProtocolTool . Name == "Returns42" ) ;
550
547
}
551
548
@@ -591,7 +588,7 @@ public async Task TitleAttributeProperty_PropagatedToTitle()
591
588
Assert . NotNull ( tools ) ;
592
589
Assert . NotEmpty ( tools ) ;
593
590
594
- McpClientTool tool = tools . First ( t => t . Name == nameof ( EchoTool . EchoComplex ) ) ;
591
+ McpClientTool tool = tools . First ( t => t . Name == "echo_complex" ) ;
595
592
596
593
Assert . Equal ( "This is a title" , tool . Title ) ;
597
594
Assert . Equal ( "This is a title" , tool . ProtocolTool . Title ) ;
@@ -607,7 +604,7 @@ public async Task HandlesIProgressParameter()
607
604
Assert . NotNull ( tools ) ;
608
605
Assert . NotEmpty ( tools ) ;
609
606
610
- McpClientTool progressTool = tools . First ( t => t . Name == nameof ( EchoTool . SendsProgressNotifications ) ) ;
607
+ McpClientTool progressTool = tools . First ( t => t . Name == "sends_progress_notifications" ) ;
611
608
612
609
TaskCompletionSource tcs = new ( TaskCreationOptions . RunContinuationsAsynchronously ) ;
613
610
int remainingNotifications = 10 ;
@@ -660,7 +657,7 @@ public async Task CancellationNotificationsPropagateToToolTokens()
660
657
var tools = await client . ListToolsAsync ( cancellationToken : TestContext . Current . CancellationToken ) ;
661
658
Assert . NotNull ( tools ) ;
662
659
Assert . NotEmpty ( tools ) ;
663
- McpClientTool cancelableTool = tools . First ( t => t . Name == nameof ( EchoTool . InfiniteCancelableOperation ) ) ;
660
+ McpClientTool cancelableTool = tools . First ( t => t . Name == "infinite_cancelable_operation" ) ;
664
661
665
662
var requestId = new RequestId ( Guid . NewGuid ( ) . ToString ( ) ) ;
666
663
var invokeTask = client . SendRequestAsync < CallToolRequestParams , CallToolResult > (
0 commit comments