You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ModelContextProtocol.Core/Client/HttpClientTransport.cs
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ public HttpClientTransport(HttpClientTransportOptions transportOptions, ILoggerF
41
41
/// <see langword="true"/> to dispose of <paramref name="httpClient"/> when the transport is disposed;
42
42
/// <see langword="false"/> if the caller is retaining ownership of the <paramref name="httpClient"/>'s lifetime.
43
43
/// </param>
44
+
/// <exception cref="ArgumentNullException"><paramref name="transportOptions"/> or <paramref name="httpClient"/> is <see langword="null"/>.</exception>
Copy file name to clipboardExpand all lines: src/ModelContextProtocol.Core/Client/McpClient.Methods.cs
+19-2Lines changed: 19 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ public abstract partial class McpClient : McpSession
20
20
/// <param name="loggerFactory">A logger factory for creating loggers for clients.</param>
21
21
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
22
22
/// <returns>An <see cref="McpClient"/> that's connected to the specified server.</returns>
23
-
/// <exception cref="ArgumentNullException"><paramref name="clientTransport"/> or <paramref name="clientOptions"/> is <see langword="null"/>.</exception>
23
+
/// <exception cref="ArgumentNullException"><paramref name="clientTransport"/> is <see langword="null"/>.</exception>
24
24
publicstaticasyncTask<McpClient>CreateAsync(
25
25
IClientTransportclientTransport,
26
26
McpClientOptions?clientOptions=null,
@@ -60,7 +60,7 @@ public static async Task<McpClient> CreateAsync(
60
60
/// <param name="loggerFactory">An optional logger factory for diagnostics.</param>
61
61
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
62
62
/// <returns>An <see cref="McpClient"/> bound to the resumed session.</returns>
63
-
/// <exception cref="ArgumentNullException">Thrown when <paramref name="clientTransport"/> or <paramref name="resumeOptions"/> is <see langword="null"/>.</exception>
63
+
/// <exception cref="ArgumentNullException"><paramref name="clientTransport"/>, <paramref name="resumeOptions"/>, <see cref="ResumeClientSessionOptions.ServerCapabilities"/>, or <see cref="ResumeClientSessionOptions.ServerInfo"/> is <see langword="null"/>.</exception>
/// <param name="requestParams">The request parameters to send in the request.</param>
105
105
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
106
106
/// <returns>A task containing the ping result.</returns>
107
+
/// <exception cref="ArgumentNullException"><paramref name="requestParams"/> is <see langword="null"/>.</exception>
107
108
/// <exception cref="McpException">The server cannot be reached or returned an error response.</exception>
108
109
publicValueTask<PingResult>PingAsync(
109
110
PingRequestParamsrequestParams,
@@ -235,6 +236,8 @@ public ValueTask<ListPromptsResult> ListPromptsAsync(
235
236
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
236
237
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
237
238
/// <returns>A task containing the prompt's result with content and messages.</returns>
239
+
/// <exception cref="ArgumentNullException"><paramref name="name"/> is <see langword="null"/>.</exception>
240
+
/// <exception cref="ArgumentException"><paramref name="name"/> is empty or composed entirely of whitespace.</exception>
@@ -391,6 +394,7 @@ public ValueTask<ListResourcesResult> ListResourcesAsync(
391
394
/// <param name="uri">The URI of the resource.</param>
392
395
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
393
396
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
397
+
/// <exception cref="ArgumentNullException"><paramref name="uri"/> is <see langword="null"/>.</exception>
@@ -405,6 +409,8 @@ public ValueTask<ReadResourceResult> ReadResourceAsync(
405
409
/// <param name="uri">The URI of the resource.</param>
406
410
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
407
411
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
412
+
/// <exception cref="ArgumentNullException"><paramref name="uri"/> is <see langword="null"/>.</exception>
413
+
/// <exception cref="ArgumentException"><paramref name="uri"/> is empty or composed entirely of whitespace.</exception>
@@ -424,6 +430,8 @@ public ValueTask<ReadResourceResult> ReadResourceAsync(
424
430
/// <param name="arguments">Arguments to use to format <paramref name="uriTemplate"/>.</param>
425
431
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
426
432
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
433
+
/// <exception cref="ArgumentNullException"><paramref name="uriTemplate"/> or <paramref name="arguments"/> is <see langword="null"/>.</exception>
434
+
/// <exception cref="ArgumentException"><paramref name="uriTemplate"/> is empty or composed entirely of whitespace.</exception>
@@ -469,6 +477,8 @@ public ValueTask<ReadResourceResult> ReadResourceAsync(
469
477
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
470
478
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
@@ -514,6 +524,7 @@ public ValueTask<CompleteResult> CompleteAsync(
514
524
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
515
525
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
516
526
/// <returns>A task that represents the asynchronous operation.</returns>
527
+
/// <exception cref="ArgumentNullException"><paramref name="uri"/> is <see langword="null"/>.</exception>
@@ -528,6 +539,8 @@ public Task SubscribeToResourceAsync(Uri uri, RequestOptions? options = null, Ca
528
539
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
529
540
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
530
541
/// <returns>A task that represents the asynchronous operation.</returns>
542
+
/// <exception cref="ArgumentNullException"><paramref name="uri"/> is <see langword="null"/>.</exception>
543
+
/// <exception cref="ArgumentException"><paramref name="uri"/> is empty or composed entirely of whitespace.</exception>
@@ -569,6 +582,7 @@ public Task SubscribeToResourceAsync(
569
582
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
570
583
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
571
584
/// <returns>A task that represents the asynchronous operation.</returns>
585
+
/// <exception cref="ArgumentNullException"><paramref name="uri"/> is <see langword="null"/>.</exception>
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
584
598
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
585
599
/// <returns>A task that represents the asynchronous operation.</returns>
600
+
/// <exception cref="ArgumentNullException"><paramref name="uri"/> is <see langword="null"/>.</exception>
601
+
/// <exception cref="ArgumentException"><paramref name="uri"/> is empty or composed entirely of whitespace.</exception>
@@ -626,6 +642,7 @@ public Task UnsubscribeFromResourceAsync(
626
642
/// <param name="options">Optional request options including metadata, serialization settings, and progress tracking.</param>
627
643
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
628
644
/// <returns>The <see cref="CallToolResult"/> from the tool execution.</returns>
645
+
/// <exception cref="ArgumentNullException"><paramref name="toolName"/> is <see langword="null"/>.</exception>
Copy file name to clipboardExpand all lines: src/ModelContextProtocol.Core/Client/StdioClientTransport.cs
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ public sealed partial class StdioClientTransport : IClientTransport
39
39
/// </summary>
40
40
/// <param name="options">Configuration options for the transport, including the command to execute, arguments, working directory, and environment variables.</param>
41
41
/// <param name="loggerFactory">A logger factory for creating loggers used for diagnostic output during transport operations.</param>
42
+
/// <exception cref="ArgumentNullException"><paramref name="options"/> is <see langword="null"/>.</exception>
0 commit comments