Class: RailsMcpInsight::Tools::AnalyzeJob
- Inherits:
-
MCP::Tool
- Object
- MCP::Tool
- RailsMcpInsight::Tools::AnalyzeJob
- Defined in:
- lib/rails_mcp_insight/tools/analyze_job.rb
Class Method Summary collapse
Class Method Details
.call(job:, server_context:) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rails_mcp_insight/tools/analyze_job.rb', line 20 def self.call(job:, server_context:) config = Configuration.new(project_path: server_context&.dig(:project_path) || Dir.pwd) analyzer = Analyzers::JobAnalyzer.new(config) result = analyzer.analyze(job) if result MCP::Tool::Response.new([{ type: "text", text: JSON.pretty_generate(result) }]) else MCP::Tool::Response.new([{ type: "text", text: "Job '#{job}' not found in app/jobs/." }]) end end |