Class: RubyEventStore::MCP::Tools::Recent
- Inherits:
-
Object
- Object
- RubyEventStore::MCP::Tools::Recent
- Defined in:
- lib/ruby_event_store/mcp/tools/recent.rb
Constant Summary collapse
- DEFAULT_LIMIT =
20
Instance Method Summary collapse
Instance Method Details
#call(event_store, args) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/ruby_event_store/mcp/tools/recent.rb', line 27 def call(event_store, args) limit = args.fetch("limit", DEFAULT_LIMIT).to_i events = event_store.read.limit(limit).backward.to_a return "(no events)" if events.empty? render(events) end |
#name ⇒ Object
9 10 11 |
# File 'lib/ruby_event_store/mcp/tools/recent.rb', line 9 def name "recent" end |
#schema ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ruby_event_store/mcp/tools/recent.rb', line 13 def schema { name: name, description: "Show the most recent events across all streams", inputSchema: { type: "object", properties: { limit: { type: "integer", description: "Number of events to return (default: #{DEFAULT_LIMIT})" } }, required: [] } } end |