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

Function isUnknownToolCause

packages/plugins/mcp/src/sdk/invoke.ts:62–68  ·  view source on GitHub ↗
(cause: unknown, toolName: string)

Source from the content-addressed store, hash-verified

60};
61
62const isUnknownToolCause = (cause: unknown, toolName: string): boolean =>
63 // oxlint-disable-next-line executor/no-instanceof-tagged-error -- boundary: MCP SDK surfaces JSON-RPC protocol errors as this Error subclass
64 cause instanceof ProtocolError &&
65 (cause.code === ProtocolErrorCode.InvalidParams ||
66 cause.code === ProtocolErrorCode.MethodNotFound) &&
67 // oxlint-disable-next-line executor/no-unknown-error-message -- boundary: instanceof narrows to the SDK's ProtocolError, whose message carries the only unknown-tool discriminator the protocol provides
68 isUnknownToolMessage(cause.message, toolName);
69
70// ---------------------------------------------------------------------------
71// Elicitation bridge — decode incoming MCP ElicitRequest, route through

Callers 1

useConnectionFunction · 0.85

Calls 1

isUnknownToolMessageFunction · 0.85

Tested by

no test coverage detected