Skip to main content
Glama
wkoutre

Linear MCP Server

by wkoutre

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
NameRequiredDescriptionDefault
teamIdNoID of the team to get cycles for (optional)
limitNoMaximum 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" }
              }
            }
          }
        }
      }
    };
  • 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),
  • Includes the linear_getCycles tool definition in the allToolDefinitions array for MCP tool registration.
    getCyclesToolDefinition,
    getActiveCycleToolDefinition,
    addIssueToCycleToolDefinition,
  • 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")
      );
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states basic functionality. It doesn't disclose behavioral traits such as pagination (implied by 'limit' parameter), authentication requirements, rate limits, whether it's read-only (implied by 'Get'), or what happens with missing parameters. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at one sentence with zero waste. It's front-loaded and gets straight to the point, though this conciseness comes at the cost of detail. Every word earns its place in stating the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a simple input schema, the description is incomplete. It doesn't explain return values (e.g., cycle fields, format), error conditions, or how parameters interact. For a tool with two parameters and no structured output info, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters (teamId and limit). The description adds no additional meaning beyond what's in the schema, such as explaining how 'teamId' affects results or default behavior when omitted. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get a list of all cycles' clearly states the verb ('Get') and resource ('cycles'), but it's vague about scope and doesn't differentiate from sibling tools like 'linear_getActiveCycle'. It doesn't specify what 'all cycles' means in context (e.g., across teams, organization-wide).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'linear_getActiveCycle' or 'linear_getIssues' (which might relate to cycles). The description implies a general listing function but doesn't provide context about prerequisites, filtering needs, or typical use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.