-32603 import {JSONRPC_INTERNAL_ERROR} from '@fuzdev/fuz_app/http/jsonrpc.js'; JSON-RPC 2.0 envelope schemas for RPC dispatch and SAES transport.
Params are object-only following MCP (no positional arrays); per-action
spec.input narrows further. Result is the full JSON-RPC valid value
space per spec §5 ("determined by the method invoked"): object, array,
string, number, boolean, or null — the per-action spec.output is the
actual contract. The envelope-level loose-object-only constraint
inherited from MCP would reject any action with output: z.null() /
z.string() / etc. on the wire, so we relax it here while keeping
MCP-superset shape on params + _meta.
MCP _meta types (JsonrpcMcpMeta, JsonrpcRequestParamsMeta) are
exported as building blocks for per-action schemas but are NOT validated
at the envelope level — _meta content validation belongs in per-action
schemas where it produces the correct error code (invalid_params, not
invalid_request).
@source https://github.com/modelcontextprotocol/typescript-sdk @see https://www.jsonrpc.org/specification
27 declarations
-32603 import {JSONRPC_INTERNAL_ERROR} from '@fuzdev/fuz_app/http/jsonrpc.js'; -32602 import {JSONRPC_INVALID_PARAMS} from '@fuzdev/fuz_app/http/jsonrpc.js'; -32600 import {JSONRPC_INVALID_REQUEST} from '@fuzdev/fuz_app/http/jsonrpc.js'; -32601 import {JSONRPC_METHOD_NOT_FOUND} from '@fuzdev/fuz_app/http/jsonrpc.js'; -32700 import {JSONRPC_PARSE_ERROR} from '@fuzdev/fuz_app/http/jsonrpc.js'; -32099 import {JSONRPC_SERVER_ERROR_END} from '@fuzdev/fuz_app/http/jsonrpc.js'; End of the server-defined error code range (-32099).
-32000 import {JSONRPC_SERVER_ERROR_START} from '@fuzdev/fuz_app/http/jsonrpc.js'; Start of the server-defined error code range (-32000).
"2.0" import {JSONRPC_VERSION} from '@fuzdev/fuz_app/http/jsonrpc.js'; value + type
-32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">) type -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">)
import {JsonrpcErrorCode} from '@fuzdev/fuz_app/http/jsonrpc.js'; A valid JSON-RPC error code — one of the 5 standard codes or a server-defined code in the -32000 to -32099 range.
value + type
{ [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; } import {JsonrpcErrorObject} from '@fuzdev/fuz_app/http/jsonrpc.js'; Error object within a JSON-RPC error response.
codetype -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">)
messagetype string
data?type unknown
[key: string]type unknown
value + type
{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<"JsonrpcServerErrorCode">); message: string; data?: unknown; }; } import {JsonrpcErrorResponse} from '@fuzdev/fuz_app/http/jsonrpc.js'; A response that indicates an error occurred.
jsonrpctype "2.0"
idtype string | number | null
errortype JsonrpcErrorObject
[key: string]type unknown
value + type
{ [x: string]: unknown; } import {JsonrpcMcpMeta} from '@fuzdev/fuz_app/http/jsonrpc.js'; MCP metadata object — loose to allow additional properties and .extend.
[key: string]type unknown
value + type
{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; } | undefined; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: JSONType; } | { ...; } | { ...; } type JsonrpcRequest | JsonrpcResponse | JsonrpcErrorResponse | JsonrpcNotification
import {JsonrpcMessage} from '@fuzdev/fuz_app/http/jsonrpc.js'; Any valid JSON-RPC message (request, notification, response, or error response).
value + type
{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; } | undefined; } | { [x: string]: unknown; jsonrpc: "2.0"; method: string; params?: { [x: string]: unknown; } | undefined; } type JsonrpcRequest | JsonrpcNotification
import {JsonrpcMessageFromClientToServer} from '@fuzdev/fuz_app/http/jsonrpc.js'; Messages a client can send to a server (request or notification).
value + type
{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: JSONType; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<...>); message: string; data?: unknown; }; } | { ...; } type JsonrpcResponse | JsonrpcErrorResponse | JsonrpcNotification
import {JsonrpcMessageFromServerToClient} from '@fuzdev/fuz_app/http/jsonrpc.js'; Messages a server can send to a client (notification, response, or error response).
value + type
string import {JsonrpcMethod} from '@fuzdev/fuz_app/http/jsonrpc.js'; A JSON-RPC method name.
value + type
{ [x: string]: unknown; jsonrpc: "2.0"; method: string; params?: { [x: string]: unknown; } | undefined; } import {JsonrpcNotification} from '@fuzdev/fuz_app/http/jsonrpc.js'; A notification which does not expect a response.
jsonrpctype "2.0"
methodtype string
params?[key: string]type unknown
value + type
{ [x: string]: unknown; } import {JsonrpcNotificationParams} from '@fuzdev/fuz_app/http/jsonrpc.js'; Notification params — loose object. Per-action schemas validate _meta content.
[key: string]type unknown
value + type
string | number type string | number
import {JsonrpcProgressToken} from '@fuzdev/fuz_app/http/jsonrpc.js'; A progress token, used to associate progress notifications with the original request.
value + type
{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; method: string; params?: { [x: string]: unknown; } | undefined; } import {JsonrpcRequest} from '@fuzdev/fuz_app/http/jsonrpc.js'; A request that expects a response.
jsonrpctype "2.0"
idtype string | number
methodtype string
params?type JsonrpcRequestParams
[key: string]type unknown
value + type
string | number type string | number
import {JsonrpcRequestId} from '@fuzdev/fuz_app/http/jsonrpc.js'; A uniquely identifying id for a request in JSON-RPC. Like MCP, excludes null.
value + type
{ [x: string]: unknown; } import {JsonrpcRequestParams} from '@fuzdev/fuz_app/http/jsonrpc.js'; Request params — loose object. Per-action schemas validate _meta content.
[key: string]type unknown
value + type
{ [x: string]: unknown; progressToken?: string | number | undefined; } import {JsonrpcRequestParamsMeta} from '@fuzdev/fuz_app/http/jsonrpc.js'; Request params metadata — extends MCP meta with optional progress token.
progressToken?If specified, the caller is requesting out-of-band progress notifications for this request. The value is an opaque token attached to subsequent notifications. The receiver is not obligated to provide these notifications.
type string | number
[key: string]type unknown
value + type
{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: JSONType; } import {JsonrpcResponse} from '@fuzdev/fuz_app/http/jsonrpc.js'; A successful (non-error) response to a request.
jsonrpctype "2.0"
idtype string | number
resulttype JSONType
[key: string]type unknown
value + type
{ [x: string]: unknown; jsonrpc: "2.0"; id: string | number; result: JSONType; } | { [x: string]: unknown; jsonrpc: "2.0"; id: string | number | null; error: { [x: string]: unknown; code: -32700 | -32600 | -32601 | -32602 | -32603 | (number & $brand<...>); message: string; data?: unknown; }; } type JsonrpcResponse | JsonrpcErrorResponse
import {JsonrpcResponseOrError} from '@fuzdev/fuz_app/http/jsonrpc.js'; A successful response or an error response.
value + type
JSONType type JSONType
import {JsonrpcResult} from '@fuzdev/fuz_app/http/jsonrpc.js'; Result — any JSON value per JSON-RPC 2.0 §5. Per-action spec.output
is the actual contract; the envelope only asserts presence + JSON-ness.
z.json() is required (not implicitly optional like z.unknown() /
z.any(), which would let an error envelope {jsonrpc, id, error}
parse successfully against the success envelope and break union
discrimination).
value + type
number & $brand<"JsonrpcServerErrorCode"> type number & $brand<"JsonrpcServerErrorCode">
import {JsonrpcServerErrorCode} from '@fuzdev/fuz_app/http/jsonrpc.js'; A server-defined error code in the -32000 to -32099 range.
z.infer<typeof JsonrpcServerErrorCode>