Class: Phlex::Reactive::MCP::Tools::ActionsTool

Inherits:
BaseTool
  • Object
show all
Defined in:
lib/phlex/reactive/mcp/tools/actions_tool.rb

Overview

phlex_reactive_actions — the full action inventory: per action, the declared param schema, source location, and the authorization heuristic. Optional component: filter narrows to one component.

Class Method Summary collapse

Methods inherited from BaseTool

annotations_value, eager_load_app!, error_response, json_response

Class Method Details

.call(component: nil, server_context: nil) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



33
34
35
36
37
38
# File 'lib/phlex/reactive/mcp/tools/actions_tool.rb', line 33

def self.call(component: nil, server_context: nil) # rubocop:disable Lint/UnusedMethodArgument
  eager_load_app!
  infos = Phlex::Reactive::Inspector.components
  infos = infos.select { it.name == component } if component
  json_response(components: infos.map { Phlex::Reactive::Inspector::Report.component_hash(it) })
end