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

@ -424,8 +424,8 @@ Task operations may throw <xref:ModelContextProtocol.McpException> with these er
| Error Code | Scenario |
|------------|----------|
| `InvalidParams` | Invalid or nonexistent task ID |
| `InvalidRequest` | Tool with `taskSupport: forbidden` called with task metadata, or tool with `taskSupport: required` called without task metadata |
| `InvalidParams` | Invalid or nonexistent task ID or invalid cursor |
| `InvalidParams` | Tool with `taskSupport: forbidden` called with task metadata, or tool with `taskSupport: required` called without task metadata |
| `InternalError` | Task execution failure or result unavailable |
Example error handling: