Class: MCP::Tool::Annotations
- Inherits:
-
Object
- Object
- MCP::Tool::Annotations
- Defined in:
- lib/mcp/tool/annotations.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(destructive_hint: true, idempotent_hint: false, open_world_hint: true, read_only_hint: false, title: nil) ⇒ Annotations
constructor
A new instance of Annotations.
- #to_h ⇒ Object
Constructor Details
#initialize(destructive_hint: true, idempotent_hint: false, open_world_hint: true, read_only_hint: false, title: nil) ⇒ Annotations
Returns a new instance of Annotations.
8 9 10 11 12 13 14 |
# File 'lib/mcp/tool/annotations.rb', line 8 def initialize(destructive_hint: true, idempotent_hint: false, open_world_hint: true, read_only_hint: false, title: nil) @title = title @read_only_hint = read_only_hint @destructive_hint = destructive_hint @idempotent_hint = idempotent_hint @open_world_hint = open_world_hint end |
Instance Attribute Details
#destructive_hint ⇒ Object (readonly)
Returns the value of attribute destructive_hint.
6 7 8 |
# File 'lib/mcp/tool/annotations.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/mcp/tool/annotations.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/mcp/tool/annotations.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/mcp/tool/annotations.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/mcp/tool/annotations.rb', line 6 def title @title end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/mcp/tool/annotations.rb', line 16 def to_h { destructiveHint: destructive_hint, idempotentHint: idempotent_hint, openWorldHint: open_world_hint, readOnlyHint: read_only_hint, title:, }.compact end |