History

chore(mcp): drop McpInvocationError from the group and extension union

Nothing in the MCP extension methods ever emits McpInvocationError; it can only surface from the plugin's invokeTool callback, which is reached via the core tools.invoke endpoint, not an MCP-group endpoint. Keep the class around (still used inside invoke.ts) but stop claiming the group or the extension type surfaces it.

Rhys Sullivan committed 6 months ago

Commit 3fbc5741 parent 7ce090d2 files · +6 −7Browse files

Unified · Split

2 files
  1. packages/plugins/mcp/src/api/group.ts +6 −5
  2. packages/plugins/mcp/src/sdk/plugin.ts +0 −2
packages/plugins/mcp/src/api/group.ts+6−5
@@ -5,7 +5,6 @@ import { InternalError } from "@executor/api"; · 4 unmodified lines
55
66 import {
77 McpConnectionError,
8− McpInvocationError,
98 McpOAuthError,
109 McpToolDiscoveryError,
1110 } from "../sdk/errors";
@@ -219,10 +218,12 @@ export class McpGroup extends HttpApiGroup.make("mcp") · 207 unmodified lines
219218 )
220219 // Errors declared once at the group level — every endpoint inherits.
221220 // Plugin domain errors carry their own HttpApiSchema status (4xx);
222− // `InternalError` is the shared opaque 500 for anything storage-side
223− // captured to telemetry by the SDK boundary.
221+ // `InternalError` is the shared opaque 500 translated at the HTTP
222+ // edge by `withStorageCapture`. We only list errors an MCP *group*
223+ // endpoint can surface: `McpInvocationError` is thrown inside
224+ // `invokeTool` which is reached via the core `tools.invoke`
225+ // endpoint, not any MCP-group endpoint, so it doesn't belong here.
224226 .addError(InternalError)
225227 .addError(McpOAuthError)
226228 .addError(McpConnectionError)
227− .addError(McpToolDiscoveryError)
228− .addError(McpInvocationError) {}
229+ .addError(McpToolDiscoveryError) {}
packages/plugins/mcp/src/sdk/plugin.ts+0−2
@@ -26,7 +26,6 @@ import { · 25 unmodified lines
2626 import { discoverTools } from "./discover";
2727 import {
2828 McpConnectionError,
29− McpInvocationError,
3029 McpOAuthError,
3130 McpToolDiscoveryError,
3231 } from "./errors";
@@ -954,7 +953,6 @@ export type McpExtensionFailure = · 921 unmodified lines
954953 | McpOAuthError
955954 | McpConnectionError
956955 | McpToolDiscoveryError
957− | McpInvocationError
958956 | StorageFailure;
959957
960958 export interface McpPluginExtension {