Class: Igniter::Extensions::Contracts::Mcp::ToolResult
- Inherits:
-
Object
- Object
- Igniter::Extensions::Contracts::Mcp::ToolResult
- Defined in:
- lib/igniter/extensions/contracts/mcp/tool_result.rb
Instance Attribute Summary collapse
-
#mutating ⇒ Object
readonly
Returns the value of attribute mutating.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#tool_name ⇒ Object
readonly
Returns the value of attribute tool_name.
Instance Method Summary collapse
-
#initialize(tool_name:, payload:, mutating:) ⇒ ToolResult
constructor
A new instance of ToolResult.
- #to_h ⇒ Object
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
#mutating ⇒ Object (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 |
#payload ⇒ Object (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_name ⇒ Object (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_h ⇒ Object
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 |