21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/rails_mcp_insight/tools/analyze_controller.rb', line 21
def self.call(controller:, server_context:)
config = Configuration.new(project_path: server_context&.dig(:project_path) || Dir.pwd)
analyzer = Analyzers::ControllerAnalyzer.new(config)
result = analyzer.analyze(controller)
if result
MCP::Tool::Response.new([{ type: "text", text: JSON.pretty_generate(result) }])
else
MCP::Tool::Response.new([{ type: "text", text: "Controller '#{controller}' not found." }])
end
end
|