Class: ListTool

Inherits:
MCP::Tool
  • Object
show all
Defined in:
lib/exe.rb

Overview

listツールの定義

Class Method Summary collapse

Class Method Details

.call(name:) ⇒ Object



40
41
42
43
44
45
46
47
# File 'lib/exe.rb', line 40

def self.call(name:)
  # 名前が文字列でない場合
  return MCP::Tool::Response.new([{ type: "text", text: "Name must be a string" }]) unless name.is_a?(String)

  # Vaultからノートを検索
  result = $vault.tool_list(name)
  MCP::Tool::Response.new([{ type: "text", text: result }])
end