Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/mcp / errors

errors

Typed error union for the @graphorin/mcp package.

Every error carries a stable lowercase MCPErrorKind discriminator, an actionable GraphorinMCPError.hint field where applicable, and an optional structured metadata bag the audit emitter persists alongside the standard runId / sessionId context.

Classes

ClassDescription
GraphorinMCPErrorBase class for every typed error produced by @graphorin/mcp.
MCPAuthErrorRaised when an authentication / authorization step fails.
MCPCallTimeoutErrorRaised when a tool call exceeds its configured timeout / aborts.
MCPCancelledErrorRaised when an in-flight call is cancelled by an AbortSignal.
MCPConnectionErrorRaised when a transport fails to connect or is dropped unexpectedly.
MCPInvalidConfigErrorRaised on invalid createMCPClient(...) configuration.
MCPProtocolErrorRaised on JSON-RPC / MCP protocol-level errors.
MCPToolExecutionErrorRaised when the MCP server reports a tool-level failure (CallToolResult.isError === true, MC-4). The server's content text rides in the message so the model keeps its self-correction signal - while the executor records a real tool FAILURE (audit, retry and error policies all engage) instead of a fake success.
MCPToolNotFoundErrorRaised when MCPClient.callTool is invoked for an unknown tool.
MCPToolPinningErrorRaised when a pinned tool-definition fingerprint does not match the server's current definition and onPinMismatch: 'reject' is set (MC-6) - the approve-then-swap rug-pull posture.
MCPTransportNotSupportedErrorRaised when an operator requests a transport / capability that the runtime does not support (e.g. resumable: true on stdio).

Interfaces

InterfaceDescription
MCPErrorMetadataCommon metadata bag attached to every GraphorinMCPError.

Type Aliases

Type AliasDescription
MCPErrorKindDiscriminator union for every error class produced by @graphorin/mcp. New kinds extend this union; never throw plain Error from framework code.