linear_getCycles
Retrieve all cycles for project management in Linear, optionally filtered by team ID, with configurable result limits.
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
- The main handler function for the linear_getCycles tool. It validates the input arguments using isGetCyclesArgs type guard and calls linearService.getCycles(teamId, limit) to fetch the cycles.export 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 definition including input_schema (teamId?: string, limit?: number) and output_schema (array of cycle objects) for linear_getCycles.export 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:72-75 (registration)Registers the handler for linear_getCycles in the tool handlers map returned by registerToolHandlers.// Cycle Management tools linear_getCycles: handleGetCycles(linearService), linear_getActiveCycle: handleGetActiveCycle(linearService), linear_addIssueToCycle: handleAddIssueToCycle(linearService),
- src/tools/definitions/index.ts:68-70 (registration)Includes the linear_getCycles tool definition in the allToolDefinitions array for MCP tool registration.getCyclesToolDefinition, getActiveCycleToolDefinition, addIssueToCycleToolDefinition,
- src/tools/type-guards.ts:469-479 (schema)Type guard function used to validate input arguments for the linear_getCycles tool.export 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") ); }