Class: TrakFlow::Mcp::Tools::TaskUpdate

Inherits:
BaseTool
  • Object
show all
Defined in:
lib/trak_flow/mcp/tools/task_update.rb

Instance Method Summary collapse

Methods inherited from BaseTool

with_database

Instance Method Details

#call(id:, title: nil, status: nil, priority: nil, description: nil, assignee: nil) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/trak_flow/mcp/tools/task_update.rb', line 19

def call(id:, title: nil, status: nil, priority: nil, description: nil, assignee: nil)
  self.class.with_database do |db|
    task = db.find_task!(id)

    task.title = title if title
    task.status = status if status
    task.priority = priority if priority
    task.description = description if description
    task.assignee = assignee if assignee

    db.update_task(task)
    task.to_h
  end
end