Class: McpServer::NotYetStartedTool
- Inherits:
-
MCP::Tool
- Object
- MCP::Tool
- McpServer::NotYetStartedTool
- Defined in:
- lib/jirametrics/mcp_server.rb
Class Method Summary collapse
- .build_row(issue:, project_name:, project_data:, current_status:, current_column:, filter:) ⇒ Object
- .call(server_context:, project: nil, project_name: nil, current_status: nil, current_column: nil, **history_args) ⇒ Object
- .format_line(row) ⇒ Object
Class Method Details
.build_row(issue:, project_name:, project_data:, current_status:, current_column:, filter:) ⇒ Object
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/jirametrics/mcp_server.rb', line 437 def self.build_row issue:, project_name:, project_data:, current_status:, current_column:, filter: started, stopped = issue.started_stopped_times return nil if started || stopped return nil unless McpServer.matches_current_state?(issue, current_status, current_column) return nil unless McpServer.matches_history?(issue, project_data[:end_time], filter) { key: issue.key, summary: issue.summary, status: issue.status.name, type: issue.type, created: issue.created.to_date, project: project_name } end |
.call(server_context:, project: nil, project_name: nil, current_status: nil, current_column: nil, **history_args) ⇒ Object
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
# File 'lib/jirametrics/mcp_server.rb', line 421 def self.call(server_context:, project: nil, project_name: nil, current_status: nil, current_column: nil, **history_args) project ||= project_name filter = McpServer::HistoryFilter.from(**history_args) rows = McpServer.collect_rows(server_context, project) do |issue, name, project_data| build_row( issue: issue, project_name: name, project_data: project_data, current_status: current_status, current_column: current_column, filter: filter ) end rows.sort_by! { |r| r[:created] } McpServer.render_rows(rows, empty: 'No unstarted work found.') { |r| format_line(r) } end |
.format_line(row) ⇒ Object
453 454 455 456 |
# File 'lib/jirametrics/mcp_server.rb', line 453 def self.format_line row "#{row[:key]} | #{row[:project]} | #{row[:type]} | #{row[:status]} | " \ "Created: #{row[:created]} | #{row[:summary]}" end |