Update McpErrorCode XML docs and fix error code usage to align with MCP spec (#1291)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
Copilot 2026-02-17 13:12:29 -08:00 • committed by GitHub
commit 186cb93630
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -526,8 +526,8 @@ public class ToolTaskSupportTests : LoggedTest
arguments: new Dictionary<string, object?> { ["input"] = "test" },
cancellationToken: TestContext.Current.CancellationToken).AsTask());
// The server returns MethodNotFound because direct invocation is not allowed for required-task tools
Assert.Equal(McpErrorCode.MethodNotFound, exception.ErrorCode);
// The server returns InvalidParams because direct invocation is not allowed for required-task tools
Assert.Equal(McpErrorCode.InvalidParams, exception.ErrorCode);
Assert.Contains("task", exception.Message, StringComparison.OrdinalIgnoreCase);
}