An error that maps onto a JSON-RPC error object.
Standard JSON-RPC 2.0 + MCP error codes.
True if url is a valid absolute URI suitable for a URL-mode elicitation.
Build the -32003 MissingRequiredClientCapabilityError a server returns when processing a request requires a client capability that was not declared in the peer's clientCapabilities (draft basic/lifecycle, draft/schema MissingRequiredClientCapabilityError). HTTP transports MUST map this onto a 400 Bad Request. The error's data.requiredCapabilities carries a ClientCapabilities object describing the capabilities the request needs.
Build a "resource not found" error using the legacy MCP-specific code (-32002). Kept for backwards compatibility; this form always emits -32002. Draft connections should instead use the version-aware overload below, which selects the version-appropriate code (draft aligns it to invalidParams / -32602).
Build a "resource not found" error whose code is selected for the negotiated protocol version: draft aligns it to invalidParams (-32602), while earlier versions use the MCP-specific -32002 (see versions.resourceNotFoundCode).
Build the JSON-RPC error object {code, message, data?}.
Build the -32042 URLElicitationRequiredError a server returns when a request cannot be processed until one or more URL-mode elicitations are completed (2025-11-25 elicitation §"URL Elicitation Required Error"). The error's data.elicitations array carries the URL-mode elicitations the client must complete first; each entry is emitted as {mode:"url", elicitationId, url, message}.
Build the conventional -1 "User rejected sampling request" error a client onSampling delegate SHOULD return when the user declines the request (client/sampling §Error Handling).
A single URL-mode elicitation entry carried by a -32042 URLElicitationRequiredError (2025-11-25 elicitation §"URL Elicitation Required Error"). Each entry directs the user to complete an out-of-band interaction at url; elicitationId correlates the request with the outcome the client later reports back.