Class: LinearToonMcp::Tools::GetStatusUpdate

Inherits:
Base
  • Object
show all
Defined in:
lib/linear_toon_mcp/tools/get_status_update.rb

Overview

Fetch a single status update by id. Returns the update regardless of whether it belongs to a project or an initiative — the parent is included in the response.

Constant Summary collapse

READ_FIELDS =
<<~GRAPHQL
  id
  body
  health
  isStale
  isDiffHidden
  createdAt
  updatedAt
  editedAt
  archivedAt
  url
  user { id name }
GRAPHQL
PROJECT_UPDATE_QUERY =
<<~GRAPHQL
  query($id: String!) {
    projectUpdate(id: $id) {
      #{READ_FIELDS.strip}
      project { id name }
    }
  }
GRAPHQL
INITIATIVE_UPDATE_QUERY =
<<~GRAPHQL
  query($id: String!) {
    initiativeUpdate(id: $id) {
      #{READ_FIELDS.strip}
      initiative { id name }
    }
  }
GRAPHQL

Instance Method Summary collapse

Methods inherited from Base

call, #call, error_response, success_response

Instance Method Details

#perform(id:) ⇒ Object



57
58
59
60
# File 'lib/linear_toon_mcp/tools/get_status_update.rb', line 57

def perform(id:)
  fetch_project_update(id) || fetch_initiative_update(id) ||
    raise(Error, "Status update not found: #{id}")
end