Skip to main content
Glama

linear_getInitiativeProjects

Retrieve all projects linked to a specific initiative in Linear, including optional archived projects, to track initiative progress and organization.

Instructions

Get all projects associated with an initiative

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
initiativeIdYesThe ID of the initiative
includeArchivedNoInclude archived projects in the results

Implementation Reference

  • The core handler function for the linear_getInitiativeProjects tool. It validates the input arguments using a type guard, logs the action, calls the LinearService to fetch associated projects, and returns them.
    export function getInitiativeProjectsHandler(linearService: LinearService) { return async (args: unknown) => { if (!isGetInitiativeProjectsInput(args)) { throw new Error('Invalid input for getInitiativeProjects'); } console.log(`[getInitiativeProjects] Fetching projects for initiative: ${args.initiativeId}`); const projects = await linearService.getInitiativeProjects( args.initiativeId, args.includeArchived, ); console.log(`[getInitiativeProjects] Retrieved ${projects.length} projects`); return projects; }; }
  • The tool definition (MCPToolDefinition) specifying the name, description, input schema, and output schema for linear_getInitiativeProjects.
    name: 'linear_getInitiativeProjects', description: 'Get all projects associated with an initiative', input_schema: { type: 'object', properties: { initiativeId: { type: 'string', description: 'The ID of the initiative', }, includeArchived: { type: 'boolean', description: 'Include archived projects in the results', default: false, }, }, required: ['initiativeId'], }, output_schema: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, description: { type: 'string' }, state: { type: 'string' }, progress: { type: 'number' }, startDate: { type: 'string' }, targetDate: { type: 'string' }, teams: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, }, }, }, url: { type: 'string' }, }, }, }, },
  • Registration of the linear_getInitiativeProjects handler within the registerToolHandlers function's return object.
    linear_deleteInitiative: deleteInitiativeHandler(linearService), linear_getInitiativeProjects: getInitiativeProjectsHandler(linearService), linear_addProjectToInitiative: addProjectToInitiativeHandler(linearService), linear_removeProjectFromInitiative: removeProjectFromInitiativeHandler(linearService),
  • Type guard function isGetInitiativeProjectsInput used by the handler to validate input arguments.
    export function isGetInitiativeProjectsInput(args: unknown): args is { initiativeId: string; includeArchived?: boolean; } { return ( typeof args === 'object' && args !== null && 'initiativeId' in args && typeof (args as { initiativeId: string }).initiativeId === 'string' && (!('includeArchived' in args) || typeof (args as { includeArchived: boolean }).includeArchived === 'boolean') ); }
  • Export of the getInitiativeProjectsHandler function from handlers/index.ts.
    getInitiativeProjectsHandler,

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