-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: add UnsupportedCapabilityError to handle capabilities custom exception #1329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
61fef52
fa105b0
6dede8e
78bb55b
fd02935
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -238,7 +238,8 @@ export enum ErrorCode { | |
| InternalError = -32603, | ||
|
|
||
| // MCP-specific error codes | ||
| UrlElicitationRequired = -32042 | ||
| UrlElicitationRequired = -32042, | ||
| UnsupportedCapability = -32043 | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -2369,6 +2370,12 @@ export class UrlElicitationRequiredError extends McpError { | |
| } | ||
| } | ||
|
|
||
| export class UnsupportedCapabilityError extends McpError { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| constructor(message: string) { | ||
| super(ErrorCode.UnsupportedCapability, message); | ||
| } | ||
| } | ||
|
|
||
| type Primitive = string | number | boolean | bigint | null | undefined; | ||
| type Flatten<T> = T extends Primitive | ||
| ? T | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per my other comment, seems like introducing a new code and a protocol-level error would be out of scope for this?
In reality, these errors would be thrown if:
enforceStrictCapabilitiesistrue