Class: TrakFlow::Mcp::Resources::TaskNext
- Inherits:
-
BaseResource
- Object
- FastMcp::Resource
- BaseResource
- TrakFlow::Mcp::Resources::TaskNext
- Defined in:
- lib/trak_flow/mcp/resources/task_next.rb
Instance Method Summary collapse
Methods inherited from BaseResource
Instance Method Details
#content ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/trak_flow/mcp/resources/task_next.rb', line 12 def content self.class.with_database do |db| tasks = db.ready_tasks next_task = tasks.first if next_task labels = db.find_labels(next_task.id) result = { task: next_task.to_h, labels: labels.map(&:name) } else result = { task: nil, message: "No ready tasks found" } end Oj.dump(result, mode: :compat, indent: 2) end end |