linear_getInitiatives
Retrieve a list of initiatives from Linear with options to include archived items and limit results, enabling efficient project tracking and management.
Instructions
Get a list of all initiatives from Linear
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| includeArchived | No | Include archived initiatives in the results | |
| limit | No | Maximum number of initiatives to return |
Implementation Reference
- The core handler function for the 'linear_getInitiatives' tool. It validates the input arguments using a type guard, logs the operation, 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 detailed 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' }, }, }, }, },
- src/tools/handlers/index.ts:91-91 (registration)Registration of the 'linear_getInitiatives' handler within the registerToolHandlers function, mapping the tool name to the curried handler.linear_getInitiatives: getInitiativesHandler(linearService),
- src/tools/type-guards.ts:721-734 (helper)Type guard function used by the handler to validate input arguments for 'linear_getInitiatives'.* Type guard for linear_getInitiatives tool arguments */ 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') ); }