Class: LinearToonMcp::Tools::GetInitiative
- Defined in:
- lib/linear_toon_mcp/tools/get_initiative.rb
Overview
Fetch a single Linear initiative by ID or name, with the projects linked to it.
Constant Summary collapse
- BASE_FIELDS =
<<~GRAPHQL id name description content status color icon targetDate createdAt updatedAt archivedAt url owner { id name } parentInitiative { id name } projects { nodes { id name } } GRAPHQL
- SUB_INITIATIVES_FIELDS =
"subInitiatives { nodes { id name status } }"
Instance Method Summary collapse
-
#perform(query:, includeSubInitiatives: false) ⇒ Object
standard:disable Naming/VariableName.
Methods inherited from Get
entity, entity_label, entity_name, #not_found_message, query_string, #variables
Methods inherited from Base
call, #call, error_response, success_response
Instance Method Details
#perform(query:, includeSubInitiatives: false) ⇒ Object
standard:disable Naming/VariableName
47 48 49 50 51 52 |
# File 'lib/linear_toon_mcp/tools/get_initiative.rb', line 47 def perform(query:, includeSubInitiatives: false) initiative_id = Resolvers::Initiative.call(value: query) graphql = build_query(includeSubInitiatives: includeSubInitiatives) data = client.query(graphql, variables: {id: initiative_id}) data["initiative"] or raise Error, "Initiative not found: #{query}" end |