You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/migration-SKILL.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -454,6 +454,36 @@ Type changes in handler context:
454
454
455
455
> These task APIs are `@experimental` and may change without notice.
456
456
457
+
## 12b. Tool Error Sanitization (Breaking Change)
458
+
459
+
Tool handlers that `throw new Error('message')` now return `"Internal error"` to clients instead of the raw error message. This prevents accidental leakage of server internals (hostnames, connection strings, stack traces) through tool error responses.
460
+
461
+
To send a user-visible error message, use the new `ToolError` class:
`ProtocolError` messages (SDK validation errors) are still passed through unchanged.
484
+
485
+
**Migration action:** If your v1 tool handlers rely on `throw new Error('user-visible message')` to communicate errors to clients, switch those throws to `throw new ToolError('user-visible message')`. No changes needed for tools that only throw errors for genuinely unexpected failures.
486
+
457
487
## 13. Client Behavioral Changes
458
488
459
489
`Client.listPrompts()`, `listResources()`, `listResourceTemplates()`, `listTools()` now return empty results when the server lacks the corresponding capability (instead of sending the request). Set `enforceStrictCapabilities: true` in `ClientOptions` to throw an error instead.
0 commit comments