Class: RubyLLM::MCP::Annotation
- Inherits:
-
Object
- Object
- RubyLLM::MCP::Annotation
- Defined in:
- lib/ruby_llm/mcp/tool.rb
Instance Attribute Summary collapse
-
#destructive_hint ⇒ Object
readonly
Returns the value of attribute destructive_hint.
-
#idempotent_hint ⇒ Object
readonly
Returns the value of attribute idempotent_hint.
-
#open_world_hint ⇒ Object
readonly
Returns the value of attribute open_world_hint.
-
#read_only_hint ⇒ Object
readonly
Returns the value of attribute read_only_hint.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(annotation) ⇒ Annotation
constructor
A new instance of Annotation.
- #to_h ⇒ Object
Constructor Details
#initialize(annotation) ⇒ Annotation
Returns a new instance of Annotation.
8 9 10 11 12 13 14 |
# File 'lib/ruby_llm/mcp/tool.rb', line 8 def initialize(annotation) @title = annotation["title"] || "" @read_only_hint = annotation["readOnlyHint"] || false @destructive_hint = annotation.fetch("destructiveHint", true) @idempotent_hint = annotation["idempotentHint"] || false @open_world_hint = annotation.fetch("openWorldHint", true) end |
Instance Attribute Details
#destructive_hint ⇒ Object (readonly)
Returns the value of attribute destructive_hint.
6 7 8 |
# File 'lib/ruby_llm/mcp/tool.rb', line 6 def destructive_hint @destructive_hint end |
#idempotent_hint ⇒ Object (readonly)
Returns the value of attribute idempotent_hint.
6 7 8 |
# File 'lib/ruby_llm/mcp/tool.rb', line 6 def idempotent_hint @idempotent_hint end |
#open_world_hint ⇒ Object (readonly)
Returns the value of attribute open_world_hint.
6 7 8 |
# File 'lib/ruby_llm/mcp/tool.rb', line 6 def open_world_hint @open_world_hint end |
#read_only_hint ⇒ Object (readonly)
Returns the value of attribute read_only_hint.
6 7 8 |
# File 'lib/ruby_llm/mcp/tool.rb', line 6 def read_only_hint @read_only_hint end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/ruby_llm/mcp/tool.rb', line 6 def title @title end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/ruby_llm/mcp/tool.rb', line 16 def to_h { title: @title, readOnlyHint: @read_only_hint, destructiveHint: @destructive_hint, idempotentHint: @idempotent_hint, openWorldHint: @open_world_hint } end |