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)
SourceClass 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.
Instance methods
error
Sourceid
Sourcemethod
Sourceresponse?
A response carries an id and no method; a notification is the other way round. Only responses are dispatched to a waiting caller.
result
Source