Skip to main content
Glama

linear_getInitiativeProjects

Retrieve all projects linked to a specific initiative in Linear, including archived projects if specified, using the initiative ID for precise filtering.

Instructions

Get all projects associated with an initiative

Input Schema

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

Implementation Reference

  • The handler function that implements the core logic for the linear_getInitiativeProjects tool. It validates the input arguments using a type guard and calls the LinearService to fetch projects associated with the given initiative.
    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 MCP tool definition for linear_getInitiativeProjects, specifying the name, description, input schema (requiring initiativeId, optional includeArchived), and output schema (array of project objects).
    { 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, mapping the tool name to getInitiativeProjectsHandler(linearService).
    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 tool 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') ); }

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