Class: RubyEventStore::MCP::Tools::AggregateHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_event_store/mcp/tools/aggregate_history.rb

Instance Method Summary collapse

Instance Method Details

#call(event_store, args) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/ruby_event_store/mcp/tools/aggregate_history.rb', line 26

def call(event_store, args)
  aggregate_type = args.fetch("aggregate_type")
  aggregate_id = args.fetch("aggregate_id")
  stream_name = "#{aggregate_type}$#{aggregate_id}"
  events = events(event_store, stream_name)
  render(stream_name, events)
end

#nameObject



7
8
9
# File 'lib/ruby_event_store/mcp/tools/aggregate_history.rb', line 7

def name
  "aggregate_history"
end

#schemaObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ruby_event_store/mcp/tools/aggregate_history.rb', line 11

def schema
  {
    name: name,
    description: "Show the full event history of an aggregate instance",
    inputSchema: {
      type: "object",
      properties: {
        aggregate_type: { type: "string", description: "Aggregate class name (e.g. Order, Payment::Invoice)" },
        aggregate_id: { type: "string", description: "Aggregate ID (UUID or other identifier)" }
      },
      required: %w[aggregate_type aggregate_id]
    }
  }
end