Skip to main content
Glama

linear_getInitiatives

Retrieve all initiatives from Linear project management, including archived items with optional filters for managing project workflows.

Instructions

Get a list of all initiatives from Linear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeArchivedNoInclude archived initiatives in the results
limitNoMaximum number of initiatives to return

Implementation Reference

  • The handler function for the 'linear_getInitiatives' tool. It validates the input using a type guard, logs the action, fetches initiatives via LinearService, and returns the list.
    export function getInitiativesHandler(linearService: LinearService) {
      return async (args: unknown) => {
        if (!isGetInitiativesInput(args)) {
          throw new Error('Invalid input for getInitiatives');
        }
    
        console.log('[getInitiatives] Fetching initiatives with options:', args);
        const initiatives = await linearService.getInitiatives(args);
        console.log(`[getInitiatives] Retrieved ${initiatives.length} initiatives`);
        return initiatives;
      };
    }
  • The MCP tool definition for 'linear_getInitiatives', including input and output schemas.
    {
      name: 'linear_getInitiatives',
      description: 'Get a list of all initiatives from Linear',
      input_schema: {
        type: 'object',
        properties: {
          includeArchived: {
            type: 'boolean',
            description: 'Include archived initiatives in the results',
            default: false,
          },
          limit: {
            type: 'number',
            description: 'Maximum number of initiatives to return',
            default: 50,
          },
        },
      },
      output_schema: {
        type: 'array',
        items: {
          type: 'object',
          properties: {
            id: { type: 'string' },
            name: { type: 'string' },
            description: { type: 'string' },
            content: { type: 'string' },
            icon: { type: 'string' },
            color: { type: 'string' },
            status: { type: 'string' },
            targetDate: { type: 'string' },
            sortOrder: { type: 'number' },
            owner: {
              type: 'object',
              properties: {
                id: { type: 'string' },
                name: { type: 'string' },
                email: { type: 'string' },
              },
            },
            url: { type: 'string' },
          },
        },
      },
    },
  • Registration of the 'linear_getInitiatives' handler in the tool handlers map.
    linear_getInitiatives: getInitiativesHandler(linearService),
  • Type guard function for validating input arguments to the 'linear_getInitiatives' tool.
    export function isGetInitiativesInput(args: unknown): args is {
      includeArchived?: boolean;
      limit?: number;
    } {
      return (
        typeof args === 'object' &&
        args !== null &&
        (!('includeArchived' in args) ||
          typeof (args as { includeArchived: boolean }).includeArchived === 'boolean') &&
        (!('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