class

MCP::Message::Response

Inherits Reference < Object

Represents a JSON-RPC 2.0 response message.

Constructors

new(id : String, result : JSON::Any | Nil = nil, error : Error | Nil = nil)
Source

Class methods

from_json(json_string : String)

Override the automatic from_json to prevent Crystal from trying to use it

Source

Instance methods

error
Source
error=(error : Error | Nil)
Source
error?

Check if this is an error response.

Source
id=(id : String)
Source
jsonrpc
Source
jsonrpc=(jsonrpc : String)
Source
result
Source
result=(result : JSON::Any | Nil)
Source
to_json
Source