Class: ActionMCP::Session::Message
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ActionMCP::Session::Message
- Includes:
- MCPMessageInspect
- Defined in:
- app/models/action_mcp/session/message.rb
Overview
Represents a message exchanged during an MCP session. Its role is to store the content and metadata of each message, including the direction (client or server), message type (request, response, notification), and any associated JSON-RPC ID.
Instance Attribute Summary collapse
-
#data ⇒ Object
Virtual attribute for data.
Instance Method Summary collapse
- #notification? ⇒ Boolean
-
#request? ⇒ Boolean
Helper methods.
- #response? ⇒ Boolean
- #rpc_method ⇒ Object
Methods included from MCPMessageInspect
Instance Attribute Details
#data ⇒ Object
Virtual attribute for data
52 53 54 |
# File 'app/models/action_mcp/session/message.rb', line 52 def data @data end |
Instance Method Details
#notification? ⇒ Boolean
97 98 99 |
# File 'app/models/action_mcp/session/message.rb', line 97 def notification? == "notification" end |
#request? ⇒ Boolean
Helper methods
93 94 95 |
# File 'app/models/action_mcp/session/message.rb', line 93 def request? == "request" end |
#response? ⇒ Boolean
101 102 103 |
# File 'app/models/action_mcp/session/message.rb', line 101 def response? == "response" end |
#rpc_method ⇒ Object
105 106 107 108 109 |
# File 'app/models/action_mcp/session/message.rb', line 105 def rpc_method return false unless request? data["method"] end |