Class: Evilution::MCP::SessionListTool Deprecated

Inherits:
MCP::Tool
  • Object
show all
Defined in:
lib/evilution/mcp/session_list_tool.rb

Overview

Deprecated.

Superseded by SessionTool (action: “list”) as of 0.22.8. No longer registered with the MCP server; retained only for direct Ruby callers. Will be removed entirely — tracked by EV-h8pw / GH #686.

Class Method Summary collapse

Class Method Details

.call(server_context:, results_dir: nil, limit: nil) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



32
33
34
35
36
37
38
39
40
41
# File 'lib/evilution/mcp/session_list_tool.rb', line 32

def call(server_context:, results_dir: nil, limit: nil)
  store_opts = {}
  store_opts[:results_dir] = results_dir if results_dir
  store = Evilution::Session::Store.new(**store_opts)
  entries = store.list
  entries = entries.first(limit) if limit

  payload = entries.map { |e| stringify_keys(e) }
  ::MCP::Tool::Response.new([{ type: "text", text: ::JSON.generate(payload) }])
end