linear_getLabels
Retrieve a list of issue labels from the Linear project management system to organize and categorize tasks effectively.
Instructions
Get a list of issue labels from Linear
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- Handler function that wraps the call to LinearService.getLabels() for the linear_getLabels toolexport function handleGetLabels(linearService: LinearService) { return async (args: unknown) => { try { return await linearService.getLabels(); } catch (error) { logError('Error getting labels', error); throw error; } }; }
- Tool definition with input (empty) and output schema for linear_getLabels matching the service responseexport const getLabelsToolDefinition: MCPToolDefinition = { name: 'linear_getLabels', description: 'Get a list of issue labels from Linear', input_schema: { type: 'object', properties: {}, }, output_schema: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, description: { type: 'string' }, color: { type: 'string' }, team: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, }, }, }, }, }, };
- src/tools/handlers/index.ts:70-70 (registration)Registration of the linear_getLabels tool handler in the registerToolHandlers functionlinear_getLabels: handleGetLabels(linearService),
- src/services/linear-service.ts:46-66 (helper)Core implementation in LinearService that fetches issue labels via Linear SDK and formats with team informationasync getLabels() { const labels = await this.client.issueLabels(); return Promise.all( labels.nodes.map(async (label) => { const teamData = label.team ? await label.team : null; return { id: label.id, name: label.name, color: label.color, description: label.description, team: teamData ? { id: teamData.id, name: teamData.name, } : null, }; }), ); }