linear_updateInitiative
Modify existing initiatives in Linear by updating fields like name, description, content, status, owner, target date, icon, and color using initiative ID.
Instructions
Update an existing initiative
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | No | Updated color in hex format | |
| content | No | Updated content in markdown format | |
| description | No | Updated description of the initiative | |
| icon | No | Updated icon emoji | |
| initiativeId | Yes | The ID of the initiative to update | |
| name | No | Updated name of the initiative | |
| ownerId | No | Updated owner ID | |
| status | No | Updated status of the initiative | |
| targetDate | No | Updated target completion date (ISO 8601 format) |
Implementation Reference
- The primary handler function for the 'linear_updateInitiative' tool. It validates the input arguments using a type guard and calls the LinearService to perform the update.export function updateInitiativeHandler(linearService: LinearService) { return async (args: unknown) => { if (!isUpdateInitiativeInput(args)) { throw new Error('Invalid input for updateInitiative'); } const { initiativeId, ...updateData } = args; console.log(`[updateInitiative] Updating initiative: ${initiativeId}`); const result = await linearService.updateInitiative(initiativeId, updateData); console.log(`[updateInitiative] Initiative updated successfully`); return result; }; }
- Tool schema definition including input and output schemas for 'linear_updateInitiative'.{ name: 'linear_updateInitiative', description: 'Update an existing initiative', input_schema: { type: 'object', properties: { initiativeId: { type: 'string', description: 'The ID of the initiative to update', }, name: { type: 'string', description: 'Updated name of the initiative', }, description: { type: 'string', description: 'Updated description of the initiative', }, content: { type: 'string', description: 'Updated content in markdown format', }, ownerId: { type: 'string', description: 'Updated owner ID', }, targetDate: { type: 'string', description: 'Updated target completion date (ISO 8601 format)', }, status: { type: 'string', description: 'Updated status of the initiative', enum: ['notStarted', 'inProgress', 'completed', 'paused'], }, icon: { type: 'string', description: 'Updated icon emoji', }, color: { type: 'string', description: 'Updated color in hex format', }, }, required: ['initiativeId'], }, output_schema: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, description: { type: 'string' }, status: { type: 'string' }, url: { type: 'string' }, }, }, },
- src/tools/handlers/index.ts:94-94 (registration)Registration of the tool handler in the registerToolHandlers function, mapping 'linear_updateInitiative' to its handler.linear_updateInitiative: updateInitiativeHandler(linearService),
- src/tools/type-guards.ts:783-811 (helper)Runtime type guard 'isUpdateInitiativeInput' for validating input arguments to the tool handler.* Type guard for linear_updateInitiative tool arguments */ export function isUpdateInitiativeInput(args: unknown): args is { initiativeId: string; name?: string; description?: string; content?: string; ownerId?: string; targetDate?: string; status?: string; icon?: string; color?: string; } { return ( typeof args === 'object' && args !== null && 'initiativeId' in args && typeof (args as { initiativeId: string }).initiativeId === 'string' && (!('name' in args) || typeof (args as { name: string }).name === 'string') && (!('description' in args) || typeof (args as { description: string }).description === 'string') && (!('content' in args) || typeof (args as { content: string }).content === 'string') && (!('ownerId' in args) || typeof (args as { ownerId: string }).ownerId === 'string') && (!('targetDate' in args) || typeof (args as { targetDate: string }).targetDate === 'string') && (!('status' in args) || typeof (args as { status: string }).status === 'string') && (!('icon' in args) || typeof (args as { icon: string }).icon === 'string') && (!('color' in args) || typeof (args as { color: string }).color === 'string') ); }