Class: Evilution::MCP::SessionTool

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

Constant Summary collapse

VALID_ACTIONS =
%w[list show diff].freeze

Class Method Summary collapse

Class Method Details

.call(server_context:, action: nil, results_dir: nil, limit: nil, path: nil, base: nil, head: nil) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



55
56
57
58
59
60
61
62
63
64
# File 'lib/evilution/mcp/session_tool.rb', line 55

def call(server_context:, action: nil, results_dir: nil, limit: nil, path: nil, base: nil, head: nil)
  return error_response("config_error", "action is required") unless action
  return error_response("config_error", "unknown action: #{action}") unless VALID_ACTIONS.include?(action)

  case action
  when "list" then list_action(results_dir: results_dir, limit: limit)
  when "show" then show_action(path: path, results_dir: results_dir)
  when "diff" then diff_action(base: base, head: head, results_dir: results_dir)
  end
end