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

@ -591,7 +591,7 @@ internal sealed partial class McpServerImpl : McpServer
{
throw new McpProtocolException(
$"Tool '{tool.ProtocolTool.Name}' does not support task-augmented execution.",
McpErrorCode.MethodNotFound);
McpErrorCode.InvalidParams);
}
// Task augmentation requested - return CreateTaskResult
@ -604,7 +604,7 @@ internal sealed partial class McpServerImpl : McpServer
throw new McpProtocolException(
$"Tool '{tool.ProtocolTool.Name}' requires task-augmented execution. " +
"Include a 'task' parameter with the request.",
McpErrorCode.MethodNotFound);
McpErrorCode.InvalidParams);
}
// Normal synchronous execution