Class: RubyEventStore::MCP::Tools::StreamShow

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

Instance Method Summary collapse

Instance Method Details

#call(event_store, args) ⇒ Object



25
26
27
28
29
# File 'lib/ruby_event_store/mcp/tools/stream_show.rb', line 25

def call(event_store, args)
  stream_name = args.fetch("stream_name")
  specification = event_store.read.stream(stream_name)
  format_stream(stream_name, specification)
end

#nameObject



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

def name
  "stream_show"
end

#schemaObject



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

def schema
  {
    name: name,
    description: "Show event count, version, and first/last event for a stream",
    inputSchema: {
      type: "object",
      properties: {
        stream_name: { type: "string", description: "Stream name" }
      },
      required: ["stream_name"]
    }
  }
end