Class: Rubydex::MCPServer::Tool::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/rubydex/mcp_server/protocol.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content, error: false) ⇒ Response

: (Array, ?bool) -> void



52
53
54
55
# File 'lib/rubydex/mcp_server/protocol.rb', line 52

def initialize(content, error: false)
  @content = content
  @error = error
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



57
58
59
# File 'lib/rubydex/mcp_server/protocol.rb', line 57

def content
  @content
end

Instance Method Details

#error?Boolean

: -> bool

Returns:

  • (Boolean)


60
61
62
# File 'lib/rubydex/mcp_server/protocol.rb', line 60

def error?
  @error
end

#to_hObject

: -> Hash



65
66
67
68
69
70
# File 'lib/rubydex/mcp_server/protocol.rb', line 65

def to_h
  {
    content: content,
    isError: error?,
  }
end