Class: SeedTool

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

Overview

Tool to seed the Firestore collection with sample products.

Class Method Summary collapse

Class Method Details

.call ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/seed_tool.rb', line 13

def call(*)
  client = FirestoreClient.instance
  unless client.db_running
    return MCP::Tool::Response.new(
      [{ type: 'text', text: 'Inventory database is not running.' }]
    )
  end

  client.seed
  MCP::Tool::Response.new(
    [{ type: 'text', text: 'Database seeded successfully.' }]
  )
end