Class: MCP::Tool::Response
- Inherits:
-
Object
- Object
- MCP::Tool::Response
- Defined in:
- lib/mcp/tool/response.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#is_error ⇒ Object
readonly
Returns the value of attribute is_error.
Instance Method Summary collapse
-
#initialize(content, is_error = false) ⇒ Response
constructor
A new instance of Response.
- #to_h ⇒ Object
Constructor Details
#initialize(content, is_error = false) ⇒ Response
8 9 10 11 |
# File 'lib/mcp/tool/response.rb', line 8 def initialize(content, is_error = false) @content = content @is_error = is_error end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/mcp/tool/response.rb', line 6 def content @content end |
#is_error ⇒ Object (readonly)
Returns the value of attribute is_error.
6 7 8 |
# File 'lib/mcp/tool/response.rb', line 6 def is_error @is_error end |
Instance Method Details
#to_h ⇒ Object
13 14 15 |
# File 'lib/mcp/tool/response.rb', line 13 def to_h { content:, isError: is_error }.compact end |