From 34d4cd75522da9e76cb7f103c2ccb2ec6808b60b Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 23:13:03 -0500 Subject: [PATCH] Add missing exception documentation for public APIs (#1339) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com> Co-authored-by: Stephen Toub --- src/ModelContextProtocol.Core/Client/McpClient.Methods.cs | 5 +++++ src/ModelContextProtocol.Core/Server/McpServer.Methods.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ModelContextProtocol.Core/Client/McpClient.Methods.cs b/src/ModelContextProtocol.Core/Client/McpClient.Methods.cs index 19ef881..057831a 100644 --- a/src/ModelContextProtocol.Core/Client/McpClient.Methods.cs +++ b/src/ModelContextProtocol.Core/Client/McpClient.Methods.cs @@ -1036,6 +1036,7 @@ public abstract partial class McpClient : McpSession /// The current state of the task. /// is . /// is empty or composed entirely of whitespace. + /// The request failed or the server returned an error response. [Experimental(Experimentals.Tasks_DiagnosticId, UrlFormat = Experimentals.Tasks_Url)] public async ValueTask GetTaskAsync( string taskId, @@ -1073,6 +1074,7 @@ public abstract partial class McpClient : McpSession /// The raw JSON result of the task. /// is . /// is empty or composed entirely of whitespace. + /// The request failed or the server returned an error response. /// /// This method sends a tasks/result request to the server, which will block until the task completes if it hasn't already. /// The server handles all polling logic internally. @@ -1099,6 +1101,7 @@ public abstract partial class McpClient : McpSession /// Optional request options including metadata, serialization settings, and progress tracking. /// The to monitor for cancellation requests. The default is . /// A list of all tasks. + /// The request failed or the server returned an error response. [Experimental(Experimentals.Tasks_DiagnosticId, UrlFormat = Experimentals.Tasks_Url)] public async ValueTask> ListTasksAsync( RequestOptions? options = null, @@ -1124,6 +1127,7 @@ public abstract partial class McpClient : McpSession /// The to monitor for cancellation requests. The default is . /// The result of the request as provided by the server. /// is . + /// The request failed or the server returned an error response. /// /// The overload retrieves all tasks by automatically handling pagination. /// This overload works with the lower-level and , returning the raw result from the server. @@ -1153,6 +1157,7 @@ public abstract partial class McpClient : McpSession /// The updated state of the task after cancellation. /// is . /// is empty or composed entirely of whitespace. + /// The request failed or the server returned an error response. /// /// Cancelling a task requests that the server stop execution. The server may not immediately cancel the task, /// and may choose to allow the task to complete if it's close to finishing. diff --git a/src/ModelContextProtocol.Core/Server/McpServer.Methods.cs b/src/ModelContextProtocol.Core/Server/McpServer.Methods.cs index 16ec7e0..3caaca5 100644 --- a/src/ModelContextProtocol.Core/Server/McpServer.Methods.cs +++ b/src/ModelContextProtocol.Core/Server/McpServer.Methods.cs @@ -1066,6 +1066,7 @@ public abstract partial class McpServer : McpSession /// The to monitor for cancellation requests. /// A task representing the asynchronous notification operation. /// is . + /// The notification failed or the client returned an error response. /// /// /// This method sends an optional status notification to inform the client of task state changes.