struct

Smith::MCP::Message

Inherits Struct < Value < Object

One decoded JSON-RPC message. Only what smith actually reads is kept: requests from the server (sampling, roots) are out of scope for stage 1 and are dropped by the reader rather than modelled here.

Constructors

new(id : Int64 | Nil, method : String | Nil, result : JSON::Any | Nil, error : RpcError | Nil)
Source

Class methods

parse(line : String) : Message | Nil

nil rather than raising: a server that writes a stray log line to stdout must not take the connection down with it.

Source

Instance methods

error
Source
method
Source
response?

A response carries an id and no method; a notification is the other way round. Only responses are dispatched to a waiting caller.

Source
result
Source