Class: Igniter::Extensions::Contracts::Mcp::ToolResult

Inherits:
Object
  • Object
show all
Defined in:
lib/igniter/extensions/contracts/mcp/tool_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tool_name:, payload:, mutating:) ⇒ ToolResult

Returns a new instance of ToolResult.



10
11
12
13
14
15
# File 'lib/igniter/extensions/contracts/mcp/tool_result.rb', line 10

def initialize(tool_name:, payload:, mutating:)
  @tool_name = tool_name.to_sym
  @payload = payload
  @mutating = mutating == true
  freeze
end

Instance Attribute Details

#mutatingObject (readonly)

Returns the value of attribute mutating.



8
9
10
# File 'lib/igniter/extensions/contracts/mcp/tool_result.rb', line 8

def mutating
  @mutating
end

#payloadObject (readonly)

Returns the value of attribute payload.



8
9
10
# File 'lib/igniter/extensions/contracts/mcp/tool_result.rb', line 8

def payload
  @payload
end

#tool_nameObject (readonly)

Returns the value of attribute tool_name.



8
9
10
# File 'lib/igniter/extensions/contracts/mcp/tool_result.rb', line 8

def tool_name
  @tool_name
end

Instance Method Details

#to_hObject



17
18
19
20
21
22
23
# File 'lib/igniter/extensions/contracts/mcp/tool_result.rb', line 17

def to_h
  {
    tool_name: tool_name,
    mutating: mutating,
    payload: payload
  }
end