Class: MCP::Tool::Annotations

Inherits:
Object
  • Object
show all
Defined in:
lib/mcp/tool/annotations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_hintObject (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_hintObject (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_hintObject (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_hintObject (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

#titleObject (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_hObject



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