zkzkMCP
SDK & API reference

Error reference

Stable error codes, stages, HTTP-like statuses, retryability, and privacy-safe presentation.

zkMCP uses evlog error catalogs as typed domain errors.

Runtime metadata

type ZkMcpErrorStage =
  | "policy"
  | "proof"
  | "replay"
  | "midnight"
  | "gateway";

interface ZkMcpErrorMetadata {
  code?: string;
  retryable: boolean;
  stage?: ZkMcpErrorStage;
  status: number;
}

Public error codes

CodeStageStatusRetryable
policy.AUTHORIZATION_DENIEDpolicy403no
policy.INVALID_POLICY_STATEpolicy500no
replay.NULLIFIER_ALREADY_USEDreplay409no
proof.GENERATION_FAILEDproof500yes
proof.SERVER_UNAVAILABLEproof503yes
proof.VERIFICATION_FAILEDproof403no
midnight.CONTRACT_UNAVAILABLEmidnight503yes
midnight.INDEXER_UNAVAILABLEmidnight503yes
midnight.INVALID_STATEmidnight500no
midnight.TX_SUBMISSION_FAILEDmidnight502yes
gateway.INVALID_MCP_REQUESTgateway400no
gateway.UPSTREAM_TOOL_FAILEDgateway502yes

Private policy diagnostics

The internal catalog also contains specific entries such as AGENT_NOT_AUTHORIZED, TOOL_NOT_AUTHORIZED, AMOUNT_EXCEEDS_LIMIT, APPROVAL_REQUIRED, and POLICY_MISMATCH.

getPrivacySafeErrorMetadata() deliberately replaces 403 policy codes with policy.AUTHORIZATION_DENIED before external presentation. Do not bypass that helper in an API or log sink if the private policy structure matters.

On this page