Commit 1c50f99
committed
fix: prevent task-augmented tool errors from being masked
Re-throw McpErrors for task-augmented requests to avoid masking them
with 'Invalid task creation result' errors in server.ts validation.
The issue occurs when a task-augmented tools/call request fails validation:
1. Error is caught in mcp.ts and wrapped via createToolError()
2. Result is validated against CreateTaskResultSchema in server.ts
3. Validation fails because the error result lacks a task property
4. User sees 'Invalid task creation result' instead of the actual error
This fix re-throws all McpError types for task-augmented requests,
allowing the actual error to propagate instead of being masked.
Fixes #13851 parent b0ef89f commit 1c50f99
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
227 | 232 | | |
228 | | - | |
| 233 | + | |
229 | 234 | | |
230 | 235 | | |
231 | 236 | | |
| |||
0 commit comments