Class: LinearToonMcp::Tools::ListUsers

Inherits:
List
  • Object
show all
Defined in:
lib/linear_toon_mcp/tools/list_users.rb

Overview

List users in the Linear workspace, optionally scoped to a team. Returns TOON-encoded array of users with id, name, and email.

Constant Summary collapse

QUERY =
<<~GRAPHQL
  query {
    users { nodes { id name email } }
  }
GRAPHQL
TEAM_MEMBERS_QUERY =
<<~GRAPHQL
  query($id: String!) {
    team(id: $id) { members { nodes { id name email } } }
  }
GRAPHQL

Instance Method Summary collapse

Methods inherited from List

connection, connection_name, query_string, #variables

Methods inherited from Base

call, #call, error_response, success_response

Instance Method Details

#perform(team: nil) ⇒ Object

Parameters:

  • team (String, nil) (defaults to: nil)

    team name or UUID (optional scope)



36
37
38
39
40
41
# File 'lib/linear_toon_mcp/tools/list_users.rb', line 36

def perform(team: nil)
  return super if team.nil?
  team_id = Resolvers::Team.call(value: team)
  data = client.query(TEAM_MEMBERS_QUERY, variables: {id: team_id})
  data.dig("team", "members") or raise Error, "Unexpected response: missing team members field"
end