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

Function isUnknownToolCause

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

Source from the content-addressed store, hash-verified

61};
62
63const isUnknownToolCause = (cause: unknown, toolName: string): boolean =>
64 // oxlint-disable-next-line executor/no-instanceof-tagged-error -- boundary: MCP SDK surfaces JSON-RPC protocol errors as this Error subclass
65 cause instanceof McpError &&
66 (cause.code === ErrorCode.InvalidParams || cause.code === ErrorCode.MethodNotFound) &&
67 // oxlint-disable-next-line executor/no-unknown-error-message -- boundary: instanceof narrows to the SDK's McpError, 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