linear_createInitiative
Create a new initiative in Linear by defining its name, description, target date, status, and owner. Use markdown for content and customize with emoji icons and color codes for organization.
Instructions
Create a new initiative
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | No | Color of the initiative in hex format | |
| content | No | Content in markdown format | |
| description | No | Description of the initiative | |
| icon | No | Icon emoji for the initiative | |
| name | Yes | Name of the initiative | |
| ownerId | No | ID of the user who owns the initiative | |
| status | No | Status of the initiative | |
| targetDate | No | Target completion date (ISO 8601 format) |
Implementation Reference
- Main handler function that validates the input using type guard and delegates to LinearService.createInitiative to perform the actual creation.export function createInitiativeHandler(linearService: LinearService) { return async (args: unknown) => { if (!isCreateInitiativeInput(args)) { throw new Error('Invalid input for createInitiative'); } console.log('[createInitiative] Creating new initiative:', args.name); const result = await linearService.createInitiative(args); console.log(`[createInitiative] Initiative created successfully`); return result; }; }
- MCPToolDefinition for linear_createInitiative including input and output schemas.{ name: 'linear_createInitiative', description: 'Create a new initiative', input_schema: { type: 'object', properties: { name: { type: 'string', description: 'Name of the initiative', }, description: { type: 'string', description: 'Description of the initiative', }, content: { type: 'string', description: 'Content in markdown format', }, ownerId: { type: 'string', description: 'ID of the user who owns the initiative', }, targetDate: { type: 'string', description: 'Target completion date (ISO 8601 format)', }, status: { type: 'string', description: 'Status of the initiative', enum: ['notStarted', 'inProgress', 'completed', 'paused'], }, icon: { type: 'string', description: 'Icon emoji for the initiative', }, color: { type: 'string', description: 'Color of the initiative in hex format', }, }, required: ['name'], }, 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:93-93 (registration)Registration of the tool handler in the registerToolHandlers function.linear_createInitiative: createInitiativeHandler(linearService),
- src/tools/type-guards.ts:754-780 (helper)Type guard function isCreateInitiativeInput used by the handler for input validation.* Type guard for linear_createInitiative tool arguments */ export function isCreateInitiativeInput(args: unknown): args is { name: string; description?: string; content?: string; ownerId?: string; targetDate?: string; status?: string; icon?: string; color?: string; } { return ( typeof args === 'object' && args !== null && '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') ); }