linear_getCycles
Retrieve all cycles for a Linear team to track project timelines and manage iterative development workflows.
Instructions
Get a list of all cycles
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamId | No | ID of the team to get cycles for (optional) | |
| limit | No | Maximum number of cycles to return (default: 25) |
Implementation Reference
- Handler function for linear_getCycles tool that validates args and calls linearService.getCyclesexport function handleGetCycles(linearService: LinearService) { return async (args: unknown) => { try { if (!isGetCyclesArgs(args)) { throw new Error('Invalid arguments for getCycles'); } return await linearService.getCycles(args.teamId, args.limit); } catch (error) { logError('Error getting cycles', error); throw error; } }; }
- Tool schema definition including input and output schemas for linear_getCyclesexport const getCyclesToolDefinition: MCPToolDefinition = { name: 'linear_getCycles', description: 'Get a list of all cycles', input_schema: { type: 'object', properties: { teamId: { type: 'string', description: 'ID of the team to get cycles for (optional)', }, limit: { type: 'number', description: 'Maximum number of cycles to return (default: 25)', }, }, }, output_schema: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, number: { type: 'number' }, name: { type: 'string' }, description: { type: 'string' }, startsAt: { type: 'string' }, endsAt: { type: 'string' }, completedAt: { type: 'string' }, team: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, key: { type: 'string' }, }, }, }, }, }, };
- src/tools/handlers/index.ts:86-86 (registration)Registration of the linear_getCycles handler in the tool handlers maplinear_getCycles: handleGetCycles(linearService),
- src/tools/type-guards.ts:651-661 (helper)Type guard function for validating arguments to linear_getCycles toolexport function isGetCyclesArgs(args: unknown): args is { teamId?: string; limit?: number; } { return ( typeof args === 'object' && args !== null && (!('teamId' in args) || typeof (args as { teamId: string }).teamId === 'string') && (!('limit' in args) || typeof (args as { limit: number }).limit === 'number') ); }