Module: MCPClient::Errors::ModernProtocolError

Overview

Recognition shared by the three 2026-07-28 spec-defined errors. Only ServerError.from_jsonrpc assigns these classes, and only to an error object that is well-formed at the JSON-RPC level (it carries a string message); #well_formed? adds the per-code data requirements from the spec's schema.

Instance Method Summary collapse

Instance Method Details

#modern_protocol_error? ⇒ Boolean

Returns whether the error identifies a modern (2026-07-28+) server.

Returns:

  • (Boolean) —

    whether the error identifies a modern (2026-07-28+) server



284
285
286
# File 'lib/mcp_client/errors.rb', line 284

def modern_protocol_error?
  Codes.modern_error_code?(code) && well_formed?
end