OpenAgentIDDocumentation
API referencenpm packages@openagentid/mcp
OpenAgentIDAPI reference

@openagentid/mcp/errors

API contract shipped by @openagentid/mcp 0.1.1. Exact exports, signatures, dependencies and availability.

All packages · Runnable examples · Start an agent

ContractValue
Package@openagentid/mcp@0.1.1
Entry point@openagentid/mcp/errors
AvailabilityEarlier SDK compatibility
Reference sourcePublished TypeScript declarations
Package enginesnode >=20

Before integrating

Declares an optional peer on @openagentid/sdk ^0.1.0, which excludes SDK 0.7.2. Reference describes the published contract; do not assume compatibility with the current SDK.

This reference is generated from the integrity-verified npm archive for this exact version. Signatures describe the public contract; they are not standalone programs. Complete examples are checked separately.

Import conditions

Use the public entry point above. The package resolves it to these shipped files; do not import its internal files directly.

ConditionPublished file
types./dist/errors.d.ts
import./dist/errors.js
require./dist/errors.cjs

Exports

AuthorizationDeniedError

Caller's verified identity does not hold the required scopes.

Signature
declare class AuthorizationDeniedError extends OpenAgentMcpError {
    constructor(toolName: string, requiredScopes: ReadonlyArray<string>, heldScopes: ReadonlyArray<string>);
}

Source: @openagentid/mcp@0.1.1, dist/errors.d.ts:56.

IdentityVerificationError

Identity envelope was present but the verifier rejected it.

Signature
declare class IdentityVerificationError extends OpenAgentMcpError {
    constructor(toolName: string, cause: unknown);
}

Source: @openagentid/mcp@0.1.1, dist/errors.d.ts:52.

McpErrorCode

Standard JSON-RPC + MCP error codes used by the middleware.

Signature
declare const McpErrorCode: {
    readonly InvalidRequest: -32600;
    readonly MethodNotFound: -32601;
    readonly InvalidParams: -32602;
    readonly InternalError: -32603;
    readonly ServerError: -32000;
    readonly AuthenticationFailed: -32001;
    readonly AuthorizationDenied: -32002;
    readonly SkillsPolicyDenied: -32003;
};

Source: @openagentid/mcp@0.1.1, dist/errors.d.ts:10.

McpErrorCodeValue

Type-only declaration; it is not a runtime value.

Signature
type McpErrorCodeValue = (typeof McpErrorCode)[keyof typeof McpErrorCode];

Source: @openagentid/mcp@0.1.1, dist/errors.d.ts:28.

MissingIdentityError

Caller did not present an OpenAgent identity envelope.

Signature
declare class MissingIdentityError extends OpenAgentMcpError {
    constructor(toolName: string);
}

Source: @openagentid/mcp@0.1.1, dist/errors.d.ts:48.

OpenAgentMcpError

Base class for all middleware errors. Subclasses set a default {@link OpenAgentMcpError.code} that maps to a JSON-RPC error code.

Signature
declare class OpenAgentMcpError extends Error {
    readonly code: McpErrorCodeValue;
    readonly data?: Record<string, unknown>;
    constructor(message: string, code: McpErrorCodeValue, data?: Record<string, unknown>);
    toJsonRpcError(): {
        code: McpErrorCodeValue;
        message: string;
        data?: Record<string, unknown>;
    };
}

Source: @openagentid/mcp@0.1.1, dist/errors.d.ts:33.

SkillsPolicyDeniedError

Skills policy hook returned allow: false.

Signature
declare class SkillsPolicyDeniedError extends OpenAgentMcpError {
    constructor(toolName: string, reason: string | undefined);
}

Source: @openagentid/mcp@0.1.1, dist/errors.d.ts:60.

Package requirements

Peer dependencies

PackagePublished rangeOptional
@modelcontextprotocol/sdk^1.27.0No
@openagentid/sdk^0.1.0Yes

Archive verification

Pinned integrity:

SHA-512 integrity
sha512-Kquw9MiLgfnmX5w7RK3FK1SYKcexe5wKJk8DtlOnEaN8k/0Z+WytXkEFWwj+W4+E9ug708jwfKHFlAjdNYSUWA==

Machine-readable API manifest · Coverage

On this page