20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/rails_mcp_insight/tools/analyze_model.rb', line 20
def self.call(model:, server_context:)
config = Configuration.new(project_path: server_context&.dig(:project_path) || Dir.pwd)
analyzer = Analyzers::ModelAnalyzer.new(config)
result = analyzer.analyze(model)
if result
MCP::Tool::Response.new([{ type: "text", text: JSON.pretty_generate(result) }])
else
MCP::Tool::Response.new([{ type: "text",
text: "Model '#{model}' not found. Check the name and try list_models to see available models." }])
end
end
|