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
| Class | Description |
|---|---|
| GraphorinMCPError | Base class for every typed error produced by @graphorin/mcp. |
| MCPAuthError | Raised when an authentication / authorization step fails. |
| MCPCallTimeoutError | Raised when a tool call exceeds its configured timeout / aborts. |
| MCPCancelledError | Raised when an in-flight call is cancelled by an AbortSignal. |
| MCPConnectionError | Raised when a transport fails to connect or is dropped unexpectedly. |
| MCPInvalidConfigError | Raised on invalid createMCPClient(...) configuration. |
| MCPProtocolError | Raised on JSON-RPC / MCP protocol-level errors. |
| MCPToolExecutionError | Raised 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. |
| MCPToolNotFoundError | Raised when MCPClient.callTool is invoked for an unknown tool. |
| MCPToolPinningError | Raised 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. |
| MCPTransportNotSupportedError | Raised when an operator requests a transport / capability that the runtime does not support (e.g. resumable: true on stdio). |
Interfaces
| Interface | Description |
|---|---|
| MCPErrorMetadata | Common metadata bag attached to every GraphorinMCPError. |
Type Aliases
| Type Alias | Description |
|---|---|
| MCPErrorKind | Discriminator union for every error class produced by @graphorin/mcp. New kinds extend this union; never throw plain Error from framework code. |