Class: LinearToonMcp::Tools::CreateIssueLabel

Inherits:
Create
  • Object
show all
Defined in:
lib/linear_toon_mcp/tools/create_issue_label.rb

Overview

Create a Linear issue label. Optionally scope the label to a team — omit team to create a workspace-wide label.

Constant Summary collapse

MUTATION =
<<~GRAPHQL
  mutation($input: IssueLabelCreateInput!) {
    issueLabelCreate(input: $input) {
      success
      issueLabel {
        id
        name
        color
        team { id name }
      }
    }
  }
GRAPHQL

Instance Method Summary collapse

Methods inherited from Create

entity, entity_label, entity_name, label, mutation, mutation_name, mutation_string, #perform

Methods inherited from Base

call, #call, error_response, #perform, success_response

Instance Method Details

#variables(name:, color: nil, team: nil) ⇒ Object



40
41
42
43
44
45
# File 'lib/linear_toon_mcp/tools/create_issue_label.rb', line 40

def variables(name:, color: nil, team: nil)
  input = {name: name}
  input[:color] = color if color
  input[:teamId] = Resolvers::Team.call(value: team) if team
  {input: input}
end