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
58 59 60 |
# File 'app/models/action_mcp/session/message.rb', line 58 def data @data end |
Instance Method Details
#notification? ⇒ Boolean
104 105 106 |
# File 'app/models/action_mcp/session/message.rb', line 104 def notification? == "notification" end |
#request? ⇒ Boolean
Helper methods
100 101 102 |
# File 'app/models/action_mcp/session/message.rb', line 100 def request? == "request" end |
#response? ⇒ Boolean
108 109 110 |
# File 'app/models/action_mcp/session/message.rb', line 108 def response? == "response" end |
#rpc_method ⇒ Object
112 113 114 115 116 |
# File 'app/models/action_mcp/session/message.rb', line 112 def rpc_method return false unless request? data["method"] end |