Class: LinearToonMcp::Tools::GetTeam

Inherits:
Get
  • Object
show all
Defined in:
lib/linear_toon_mcp/tools/get_team.rb

Overview

Fetch a single Linear team by id, key, or name.

Constant Summary collapse

QUERY =
<<~GRAPHQL
  query($id: String!) {
    team(id: $id) {
      id
      name
      key
      description
      color
      icon
      timezone
      createdAt
    }
  }
GRAPHQL

Instance Method Summary collapse

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:) ⇒ Object



38
39
40
41
42
# File 'lib/linear_toon_mcp/tools/get_team.rb', line 38

def perform(query:)
  team_id = Resolvers::Team.call(value: query)
  data = client.query(QUERY, variables: {id: team_id})
  data["team"] or raise Error, "Team not found: #{query}"
end