Class: Manceps::Tool
- Inherits:
-
Object
- Object
- Manceps::Tool
- Defined in:
- lib/manceps/tool.rb
Overview
An MCP tool definition.
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#input_schema ⇒ Object
readonly
Returns the value of attribute input_schema.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#output_schema ⇒ Object
readonly
Returns the value of attribute output_schema.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(data) ⇒ Tool
constructor
A new instance of Tool.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ Tool
Returns a new instance of Tool.
8 9 10 11 12 13 14 15 |
# File 'lib/manceps/tool.rb', line 8 def initialize(data) @name = data['name'] @description = data['description'] @title = data['title'] @input_schema = data['inputSchema'] @output_schema = data['outputSchema'] @annotations = data['annotations'] end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
6 7 8 |
# File 'lib/manceps/tool.rb', line 6 def annotations @annotations end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/manceps/tool.rb', line 6 def description @description end |
#input_schema ⇒ Object (readonly)
Returns the value of attribute input_schema.
6 7 8 |
# File 'lib/manceps/tool.rb', line 6 def input_schema @input_schema end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/manceps/tool.rb', line 6 def name @name end |
#output_schema ⇒ Object (readonly)
Returns the value of attribute output_schema.
6 7 8 |
# File 'lib/manceps/tool.rb', line 6 def output_schema @output_schema end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/manceps/tool.rb', line 6 def title @title end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 |
# File 'lib/manceps/tool.rb', line 17 def to_h h = { 'name' => name, 'description' => description, 'inputSchema' => input_schema } h['title'] = title if title h['outputSchema'] = output_schema if output_schema h end |