@@ -229,35 +229,6 @@ public static partial void TransportEndpointEventParseFailed(
229
229
string data ,
230
230
Exception exception ) ;
231
231
232
- /// <summary>
233
- /// Logs an error that occurred during JSON-RPC message handling.
234
- /// </summary>
235
- /// <param name="logger">The logger to write the error message to.</param>
236
- /// <param name="endpointName">The name of the endpoint where the error occurred.</param>
237
- /// <param name="messageType">The type name of the message that was being processed.</param>
238
- /// <param name="payload">The serialized JSON content of the message for debugging.</param>
239
- /// <param name="exception">The exception that was thrown during message handling.</param>
240
- /// <remarks>
241
- /// <para>
242
- /// This method logs at Error level (EventId 7008) and captures details about unexpected exceptions
243
- /// that occur during the processing of JSON-RPC messages that aren't handled by more specific
244
- /// error logging methods.
245
- /// </para>
246
- /// <para>
247
- /// Example usage:
248
- /// </para>
249
- /// <code>
250
- /// try
251
- /// {
252
- /// await HandleMessageAsync(message, cancellationToken);
253
- /// }
254
- /// catch (Exception ex) when (ex is not OperationCanceledException)
255
- /// {
256
- /// var payload = JsonSerializer.Serialize(message, McpJsonUtilities.JsonContext.Default.IJsonRpcMessage);
257
- /// _logger.MessageHandlerError(EndpointName, message.GetType().Name, payload, ex);
258
- /// }
259
- /// </code>
260
- /// </remarks>
261
232
[ LoggerMessage (
262
233
EventId = 7008 ,
263
234
Level = LogLevel . Error ,
@@ -279,15 +250,6 @@ public static partial void TransportWritingMessageToChannel(
279
250
this ILogger logger ,
280
251
IJsonRpcMessage message ) ;
281
252
282
- /// <summary>
283
- /// Logs when a message has been successfully written to a transport channel.
284
- /// </summary>
285
- /// <param name="logger">The logger to write the message to.</param>
286
- /// <remarks>
287
- /// This method logs at Trace level and is primarily used for debugging transport-level
288
- /// message flow. The message contains no parameters and simply indicates that a message
289
- /// was written to the channel.
290
- /// </remarks>
291
253
[ LoggerMessage (
292
254
EventId = 7010 ,
293
255
Level = LogLevel . Trace ,
@@ -305,29 +267,6 @@ public static partial void TransportMessageRead(
305
267
string endpointName ,
306
268
string messageType ) ;
307
269
308
- /// <summary>
309
- /// Logs a warning when no handler is found for a JSON-RPC request method.
310
- /// </summary>
311
- /// <param name="logger">The logger to write the warning message to.</param>
312
- /// <param name="endpointName">The name of the endpoint that received the request.</param>
313
- /// <param name="method">The method name in the request that has no registered handler.</param>
314
- /// <remarks>
315
- /// <para>
316
- /// This method logs at Warning level (EventId 7012) when a JSON-RPC request is received
317
- /// but no handler has been registered for the requested method. This typically indicates
318
- /// a client is requesting a capability that the server doesn't support.
319
- /// </para>
320
- /// <para>
321
- /// Example usage:
322
- /// </para>
323
- /// <code>
324
- /// if (!_requestHandlers.TryGetValue(request.Method, out var handler))
325
- /// {
326
- /// _logger.NoHandlerFoundForRequest(EndpointName, request.Method);
327
- /// throw new McpException("The method does not exist or is not available.", ErrorCodes.MethodNotFound);
328
- /// }
329
- /// </code>
330
- /// </remarks>
331
270
[ LoggerMessage (
332
271
EventId = 7012 ,
333
272
Level = LogLevel . Warning ,
@@ -338,29 +277,6 @@ public static partial void NoHandlerFoundForRequest(
338
277
string endpointName ,
339
278
string method ) ;
340
279
341
- /// <summary>
342
- /// Logs at trace level when a response message has been successfully matched to a pending request by its message ID.
343
- /// </summary>
344
- /// <param name="logger">The logger to write the trace message to.</param>
345
- /// <param name="endpointName">The name of the endpoint that received the response message.</param>
346
- /// <param name="messageId">The unique identifier of the message that was matched to a pending request.</param>
347
- /// <remarks>
348
- /// <para>
349
- /// This method logs at Trace level (EventId 7013) when the JSON-RPC message correlation system
350
- /// successfully identifies a response message that corresponds to a previously sent request.
351
- /// This is part of the request/response tracking mechanism in the MCP framework.
352
- /// </para>
353
- /// <para>
354
- /// Example usage:
355
- /// </para>
356
- /// <code>
357
- /// if (_pendingRequests.TryRemove(messageWithId.Id, out var tcs))
358
- /// {
359
- /// _logger.ResponseMatchedPendingRequest(EndpointName, messageWithId.Id.ToString());
360
- /// tcs.TrySetResult(message);
361
- /// }
362
- /// </code>
363
- /// </remarks>
364
280
[ LoggerMessage (
365
281
EventId = 7013 ,
366
282
Level = LogLevel . Trace ,
@@ -371,14 +287,6 @@ public static partial void ResponseMatchedPendingRequest(
371
287
string endpointName ,
372
288
string messageId ) ;
373
289
374
- /// <summary>
375
- /// Logs a warning when an endpoint handler receives a message with an unexpected type.
376
- /// This occurs when a message doesn't match any of the expected JSON-RPC message types
377
- /// (request, notification, or message with ID).
378
- /// </summary>
379
- /// <param name="logger">The logger to use.</param>
380
- /// <param name="endpointName">The name of the endpoint that received the message.</param>
381
- /// <param name="messageType">The type name of the unexpected message.</param>
382
290
[ LoggerMessage (
383
291
EventId = 7014 ,
384
292
Level = LogLevel . Warning ,
@@ -389,28 +297,6 @@ public static partial void EndpointHandlerUnexpectedMessageType(
389
297
string endpointName ,
390
298
string messageType ) ;
391
299
392
- /// <summary>
393
- /// Logs a debug message when a request has been sent and the system is waiting for a response.
394
- /// </summary>
395
- /// <param name="logger">The logger to write the message to.</param>
396
- /// <param name="endpointName">The name of the endpoint the request was sent to.</param>
397
- /// <param name="method">The method name in the request.</param>
398
- /// <param name="id">The ID of the request being tracked.</param>
399
- /// <remarks>
400
- /// <para>
401
- /// This method logs at Debug level and tracks that a request has been successfully sent through
402
- /// the transport layer and the system is now awaiting a response.
403
- /// </para>
404
- /// <para>
405
- /// Example usage:
406
- /// </para>
407
- /// <code>
408
- /// await _transport.SendMessageAsync(request, cancellationToken).ConfigureAwait(false);
409
- ///
410
- /// _logger.RequestSentAwaitingResponse(EndpointName, request.Method, request.Id.ToString());
411
- /// var response = await tcs.Task.WaitAsync(cancellationToken).ConfigureAwait(false);
412
- /// </code>
413
- /// </remarks>
414
300
[ LoggerMessage (
415
301
EventId = 7015 ,
416
302
Level = LogLevel . Debug ,
@@ -422,35 +308,6 @@ public static partial void RequestSentAwaitingResponse(
422
308
string method ,
423
309
string id ) ;
424
310
425
- /// <summary>
426
- /// Logs an error when a server initialization attempt is made while the server is already initializing.
427
- /// </summary>
428
- /// <param name="logger">The logger to write the error message to.</param>
429
- /// <param name="endpointName">The name of the endpoint that is already initializing.</param>
430
- /// <remarks>
431
- /// <para>
432
- /// This method logs at Error level (EventId 7016) when a second attempt is made to initialize
433
- /// a server that is already in the initialization process. This typically occurs when multiple
434
- /// initialization requests are sent to the same server endpoint concurrently.
435
- /// </para>
436
- /// <para>
437
- /// During the initialization sequence, a server can only process one initialization request at a time.
438
- /// Attempting to start initialization when it's already in progress indicates a potential race condition
439
- /// or improper sequencing of client-server communication.
440
- /// </para>
441
- /// <para>
442
- /// Example usage:
443
- /// </para>
444
- /// <code>
445
- /// if (_isInitializing)
446
- /// {
447
- /// _logger.ServerAlreadyInitializing(EndpointName);
448
- /// throw new McpException("Server is already initializing", ErrorCodes.ServerAlreadyInitialized);
449
- /// }
450
- ///
451
- /// _isInitializing = true;
452
- /// </code>
453
- /// </remarks>
454
311
[ LoggerMessage (
455
312
EventId = 7016 ,
456
313
Level = LogLevel . Error ,
@@ -460,33 +317,6 @@ public static partial void ServerAlreadyInitializing(
460
317
this ILogger logger ,
461
318
string endpointName ) ;
462
319
463
- /// <summary>
464
- /// Logs an error that occurs during server initialization.
465
- /// </summary>
466
- /// <param name="logger">The logger to write the error message to.</param>
467
- /// <param name="endpointName">The name of the endpoint where the initialization error occurred.</param>
468
- /// <param name="e">The exception that was thrown during server initialization.</param>
469
- /// <remarks>
470
- /// <para>
471
- /// This method logs at Error level (EventId 7017) when an error occurs during the initialization
472
- /// of a server endpoint. This typically indicates a problem with establishing the initial connection
473
- /// or handshake with the server component.
474
- /// </para>
475
- /// <para>
476
- /// Example usage:
477
- /// </para>
478
- /// <code>
479
- /// try
480
- /// {
481
- /// await InitializeServerAsync(cancellationToken).ConfigureAwait(false);
482
- /// }
483
- /// catch (Exception ex) when (ex is not OperationCanceledException)
484
- /// {
485
- /// _logger.ServerInitializationError(EndpointName, ex);
486
- /// throw;
487
- /// }
488
- /// </code>
489
- /// </remarks>
490
320
[ LoggerMessage (
491
321
EventId = 7017 ,
492
322
Level = LogLevel . Error ,
@@ -497,32 +327,6 @@ public static partial void ServerInitializationError(
497
327
string endpointName ,
498
328
Exception e ) ;
499
329
500
- /// <summary>
501
- /// Logs at debug level when a POST request to the SSE transport has been accepted by the server.
502
- /// </summary>
503
- /// <param name="logger">The logger to write the debug message to.</param>
504
- /// <param name="endpointName">The name of the endpoint that sent the POST request.</param>
505
- /// <param name="messageId">The unique identifier of the message that was accepted.</param>
506
- /// <remarks>
507
- /// <para>
508
- /// This method logs at Debug level (EventId 7018) when a JSON-RPC message sent via HTTP POST
509
- /// to an SSE endpoint has been accepted by the server. The server responds with "accepted"
510
- /// to indicate that it has received the message and will process it asynchronously.
511
- /// </para>
512
- /// <para>
513
- /// The actual response to the message will be delivered later via the Server-Sent Events (SSE) stream.
514
- /// This logging helps track the asynchronous message flow in the SSE transport implementation.
515
- /// </para>
516
- /// <para>
517
- /// Example usage:
518
- /// </para>
519
- /// <code>
520
- /// if (responseContent.Equals("accepted", StringComparison.OrdinalIgnoreCase))
521
- /// {
522
- /// _logger.SSETransportPostAccepted(EndpointName, messageId);
523
- /// }
524
- /// </code>
525
- /// </remarks>
526
330
[ LoggerMessage (
527
331
EventId = 7018 ,
528
332
Level = LogLevel . Debug ,
0 commit comments