linear_get_teams
Retrieve team information from Linear's issue tracking system, including archived teams and configurable result limits for organizational management.
Instructions
Get teams in the organization
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeArchived | No | Include archived teams | |
| limit | No | Maximum number of teams to return (default: 50) |
Implementation Reference
- src/tools/linear_get_teams.ts:5-56 (handler)The main execution handler for the linear_get_teams tool. Fetches teams from the Linear API, processes the response, and returns formatted JSON or error messages.export const linearGetTeamsHandler: ToolHandler = async () => { try { // Fetch teams using the Linear API const teamsResponse = await linearClient.teams(); if (!teamsResponse) { return { content: [ { type: 'text', text: 'Error: Failed to fetch teams', }, ], isError: true, }; } // Extract team data const teams = teamsResponse.nodes.map(team => ({ id: team.id, name: team.name, key: team.key, description: team.description || '', })); return { content: [ { type: 'text', text: JSON.stringify(teams), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : typeof error === 'string' ? error : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error: ${errorMessage}`, }, ], isError: true, }; } };
- src/tools/linear_get_teams.ts:63-75 (schema)Input schema defining optional parameters for the tool: includeArchived (boolean) and limit (number).inputSchema: { type: 'object', properties: { includeArchived: { type: 'boolean', description: 'Include archived teams', }, limit: { type: 'number', description: 'Maximum number of teams to return (default: 50)', }, }, },
- src/tools/linear_get_teams.ts:59-78 (registration)Registers the linear_get_teams tool with the registry, including name, description, input schema, and the handler function.export const linearGetTeamsTool = registerTool( { name: 'linear_get_teams', description: 'Get teams in the organization', inputSchema: { type: 'object', properties: { includeArchived: { type: 'boolean', description: 'Include archived teams', }, limit: { type: 'number', description: 'Maximum number of teams to return (default: 50)', }, }, }, }, linearGetTeamsHandler );