linear_addProjectToInitiative
Link a project to an initiative in Linear to organize related work under strategic goals. Specify the initiative and project IDs to establish the connection.
Instructions
Add a project to an initiative
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| initiativeId | Yes | The ID of the initiative | |
| projectId | Yes | The ID of the project to add |
Implementation Reference
- The core handler function for the linear_addProjectToInitiative tool. Validates input using type guard and delegates to LinearService.addProjectToInitiative.export function addProjectToInitiativeHandler(linearService: LinearService) { return async (args: unknown) => { if (!isAddProjectToInitiativeInput(args)) { throw new Error('Invalid input for addProjectToInitiative'); } console.log( `[addProjectToInitiative] Adding project ${args.projectId} to initiative ${args.initiativeId}`, ); const result = await linearService.addProjectToInitiative(args.initiativeId, args.projectId); console.log(`[addProjectToInitiative] Project added successfully`); return result; }; }
- MCP tool definition including input and output schemas for linear_addProjectToInitiative.name: 'linear_addProjectToInitiative', description: 'Add a project to an initiative', input_schema: { type: 'object', properties: { initiativeId: { type: 'string', description: 'The ID of the initiative', }, projectId: { type: 'string', description: 'The ID of the project to add', }, }, required: ['initiativeId', 'projectId'], }, output_schema: { type: 'object', properties: { success: { type: 'boolean' }, project: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, initiative: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, }, }, }, }, }, }, },
- src/tools/handlers/index.ts:99-99 (registration)Registration of the tool handler in the main tool handlers map.linear_addProjectToInitiative: addProjectToInitiativeHandler(linearService),
- src/tools/type-guards.ts:861-873 (helper)Type guard function used in the handler to validate input arguments for linear_addProjectToInitiative.export function isAddProjectToInitiativeInput(args: unknown): args is { initiativeId: string; projectId: string; } { return ( typeof args === 'object' && args !== null && 'initiativeId' in args && typeof (args as { initiativeId: string }).initiativeId === 'string' && 'projectId' in args && typeof (args as { projectId: string }).projectId === 'string' ); }