Skip to main content
Glama

linear_getCycles

Retrieve a list of cycles from Linear, optionally filtering by team and limiting the number of results. Ideal for project tracking and cycle management.

Instructions

Get a list of all cycles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of cycles to return (default: 25)
teamIdNoID of the team to get cycles for (optional)

Implementation Reference

  • The handler function for the linear_getCycles tool. It validates the input arguments using a type guard and delegates to LinearService.getCycles.
    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; } }; }
  • MCP tool definition for linear_getCycles, specifying name, description, input schema (teamId?, limit?), and output schema (array of cycle objects).
    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' }, }, }, }, }, }, };
  • Maps the tool name 'linear_getCycles' to its handler function in the registerToolHandlers function.
    linear_getCycles: handleGetCycles(linearService),
  • Type guard function isGetCyclesArgs used by the handler to validate input arguments.
    * Type guard for linear_getCycles tool arguments */ 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') ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tacticlaunch/mcp-linear'

If you have feedback or need assistance with the MCP directory API, please join our Discord server