Class: Evilution::MCP::SessionTool Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

VALID_ACTIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

%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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



59
60
61
62
63
64
65
66
67
68
# File 'lib/evilution/mcp/session_tool.rb', line 59

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