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
5 5
6import {6import {
7 McpConnectionError,7 McpConnectionError,
8 McpInvocationError,
9 McpOAuthError,8 McpOAuthError,
10 McpToolDiscoveryError,9 McpToolDiscoveryError,
11} from "../sdk/errors";10} from "../sdk/errors";
@@ -219,10 +218,12 @@ export class McpGroup extends HttpApiGroup.make("mcp") · 207 unmodified lines
219 )218 )
220 // Errors declared once at the group level — every endpoint inherits.219 // Errors declared once at the group level — every endpoint inherits.
221 // Plugin domain errors carry their own HttpApiSchema status (4xx);220 // Plugin domain errors carry their own HttpApiSchema status (4xx);
222 // `InternalError` is the shared opaque 500 for anything storage-side221 // `InternalError` is the shared opaque 500 translated at the HTTP
223 // captured to telemetry by the SDK boundary.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.
224 .addError(InternalError)226 .addError(InternalError)
225 .addError(McpOAuthError)227 .addError(McpOAuthError)
226 .addError(McpConnectionError)228 .addError(McpConnectionError)
227 .addError(McpToolDiscoveryError)229 .addError(McpToolDiscoveryError) {}
228 .addError(McpInvocationError) {}
packages/plugins/mcp/src/sdk/plugin.ts+0−2
@@ -26,7 +26,6 @@ import { · 25 unmodified lines
26import { discoverTools } from "./discover";26import { discoverTools } from "./discover";
27import {27import {
28 McpConnectionError,28 McpConnectionError,
29 McpInvocationError,
30 McpOAuthError,29 McpOAuthError,
31 McpToolDiscoveryError,30 McpToolDiscoveryError,
32} from "./errors";31} from "./errors";
@@ -954,7 +953,6 @@ export type McpExtensionFailure = · 921 unmodified lines
954 | McpOAuthError953 | McpOAuthError
955 | McpConnectionError954 | McpConnectionError
956 | McpToolDiscoveryError955 | McpToolDiscoveryError
957 | McpInvocationError
958 | StorageFailure;956 | StorageFailure;
959 957
960export interface McpPluginExtension {958export interface McpPluginExtension {