MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / asProtocolError

Function asProtocolError

packages/plugins/mcp/src/sdk/invoke.ts:66–71  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

64};
65
66const asProtocolError = (cause: unknown): ProtocolError | undefined => {
67 const sdk = mcpClientSdkIfLoaded();
68 if (sdk === undefined) return undefined;
69 // oxlint-disable-next-line executor/no-instanceof-tagged-error -- boundary: MCP SDK surfaces JSON-RPC protocol errors as this Error subclass
70 return cause instanceof sdk.client.ProtocolError ? cause : undefined;
71};
72
73const isUnknownToolCause = (cause: unknown, toolName: string): boolean => {
74 const sdk = mcpClientSdkIfLoaded();

Callers 2

isUnknownToolCauseFunction · 0.85
useConnectionFunction · 0.85

Calls 1

mcpClientSdkIfLoadedFunction · 0.90

Tested by

no test coverage detected