linear_createIssue
Generate and manage tasks in Linear by creating issues with titles, descriptions, priority levels, due dates, and team assignments. Simplify project tracking and collaboration.
Instructions
Create a new issue in Linear
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assigneeId | No | ID of the user to assign the issue to | |
| cycleId | No | ID of the cycle to add the issue to | |
| description | No | Description of the issue (Markdown supported) | |
| dueDate | No | The date at which the issue is due (YYYY-MM-DD format) | |
| estimate | No | The estimated complexity/points for the issue | |
| labelIds | No | IDs of the labels to attach to the issue | |
| parentId | No | ID of the parent issue (to create as a sub-task) | |
| priority | No | Priority of the issue (0 = No priority, 1 = Urgent, 2 = High, 3 = Normal, 4 = Low) | |
| projectId | No | ID of the project the issue belongs to | |
| sortOrder | No | The position of the issue in relation to other issues | |
| stateId | No | ID of the workflow state for the issue | |
| subscriberIds | No | IDs of the users to subscribe to the issue | |
| teamId | Yes | ID of the team the issue belongs to | |
| templateId | No | ID of a template to use for creating the issue | |
| title | Yes | Title of the issue |
Implementation Reference
- The main handler function for the linear_createIssue tool. It validates input arguments using isCreateIssueArgs type guard and delegates the creation to LinearService.createIssue./** * Handler for creating an issue */ export function handleCreateIssue(linearService: LinearService) { return async (args: unknown) => { try { if (!isCreateIssueArgs(args)) { throw new Error('Invalid arguments for createIssue'); } return await linearService.createIssue(args); } catch (error) { logError('Error creating issue', error); throw error; } }; }
- The tool definition including input and output schemas for linear_createIssue.export const createIssueToolDefinition: MCPToolDefinition = { name: 'linear_createIssue', description: 'Create a new issue in Linear', input_schema: { type: 'object', properties: { title: { type: 'string', description: 'Title of the issue', }, description: { type: 'string', description: 'Description of the issue (Markdown supported)', }, teamId: { type: 'string', description: 'ID of the team the issue belongs to', }, assigneeId: { type: 'string', description: 'ID of the user to assign the issue to', }, priority: { type: 'number', description: 'Priority of the issue (0 = No priority, 1 = Urgent, 2 = High, 3 = Normal, 4 = Low)', }, projectId: { type: 'string', description: 'ID of the project the issue belongs to', }, cycleId: { type: 'string', description: 'ID of the cycle to add the issue to', }, estimate: { type: 'number', description: 'The estimated complexity/points for the issue', }, dueDate: { type: 'string', description: 'The date at which the issue is due (YYYY-MM-DD format)', }, labelIds: { type: 'array', items: { type: 'string' }, description: 'IDs of the labels to attach to the issue', }, parentId: { type: 'string', description: 'ID of the parent issue (to create as a sub-task)', }, subscriberIds: { type: 'array', items: { type: 'string' }, description: 'IDs of the users to subscribe to the issue', }, stateId: { type: 'string', description: 'ID of the workflow state for the issue', }, templateId: { type: 'string', description: 'ID of a template to use for creating the issue', }, sortOrder: { type: 'number', description: 'The position of the issue in relation to other issues', }, }, required: ['title', 'teamId'], }, output_schema: { type: 'object', properties: { id: { type: 'string' }, identifier: { type: 'string' }, title: { type: 'string' }, url: { type: 'string' }, }, }, };
- src/tools/handlers/index.ts:64-126 (registration)The registration function that maps 'linear_createIssue' to its handler function handleCreateIssue.export function registerToolHandlers(linearService: LinearService) { return { // User tools linear_getViewer: handleGetViewer(linearService), linear_getOrganization: handleGetOrganization(linearService), linear_getUsers: handleGetUsers(linearService), linear_getLabels: handleGetLabels(linearService), // Team tools linear_getTeams: handleGetTeams(linearService), linear_getWorkflowStates: handleGetWorkflowStates(linearService), // Project tools linear_getProjects: handleGetProjects(linearService), linear_createProject: handleCreateProject(linearService), // Project Management tools linear_updateProject: handleUpdateProject(linearService), linear_addIssueToProject: handleAddIssueToProject(linearService), linear_getProjectIssues: handleGetProjectIssues(linearService), // Cycle Management tools linear_getCycles: handleGetCycles(linearService), linear_getActiveCycle: handleGetActiveCycle(linearService), linear_addIssueToCycle: handleAddIssueToCycle(linearService), // Initiative Management tools linear_getInitiatives: getInitiativesHandler(linearService), linear_getInitiativeById: getInitiativeByIdHandler(linearService), linear_createInitiative: createInitiativeHandler(linearService), linear_updateInitiative: updateInitiativeHandler(linearService), linear_archiveInitiative: archiveInitiativeHandler(linearService), linear_unarchiveInitiative: unarchiveInitiativeHandler(linearService), linear_deleteInitiative: deleteInitiativeHandler(linearService), linear_getInitiativeProjects: getInitiativeProjectsHandler(linearService), linear_addProjectToInitiative: addProjectToInitiativeHandler(linearService), linear_removeProjectFromInitiative: removeProjectFromInitiativeHandler(linearService), // Issue tools linear_getIssues: handleGetIssues(linearService), linear_getIssueById: handleGetIssueById(linearService), linear_searchIssues: handleSearchIssues(linearService), linear_createIssue: handleCreateIssue(linearService), linear_updateIssue: handleUpdateIssue(linearService), linear_createComment: handleCreateComment(linearService), linear_addIssueLabel: handleAddIssueLabel(linearService), linear_removeIssueLabel: handleRemoveIssueLabel(linearService), // New Issue Management tools linear_assignIssue: handleAssignIssue(linearService), linear_subscribeToIssue: handleSubscribeToIssue(linearService), linear_convertIssueToSubtask: handleConvertIssueToSubtask(linearService), linear_createIssueRelation: handleCreateIssueRelation(linearService), linear_archiveIssue: handleArchiveIssue(linearService), linear_setIssuePriority: handleSetIssuePriority(linearService), linear_transferIssue: handleTransferIssue(linearService), linear_duplicateIssue: handleDuplicateIssue(linearService), linear_getIssueHistory: handleGetIssueHistory(linearService), // Comment Management tools linear_getComments: handleGetComments(linearService), }; }
- src/tools/type-guards.ts:91-132 (helper)Type guard function used by the handler to validate input arguments for linear_createIssue./** * Type guard for linear_createIssue tool arguments */ export function isCreateIssueArgs(args: unknown): args is { title: string; description?: string; teamId: string; assigneeId?: string; priority?: number; projectId?: string; cycleId?: string; estimate?: number; dueDate?: string; labelIds?: string[]; parentId?: string; subscriberIds?: string[]; stateId?: string; templateId?: string; sortOrder?: number; } { return ( typeof args === 'object' && args !== null && 'title' in args && typeof (args as { title: string }).title === 'string' && 'teamId' in args && typeof (args as { teamId: string }).teamId === 'string' && (!('assigneeId' in args) || typeof (args as { assigneeId: string }).assigneeId === 'string') && (!('priority' in args) || typeof (args as { priority: number }).priority === 'number') && (!('projectId' in args) || typeof (args as { projectId: string }).projectId === 'string') && (!('cycleId' in args) || typeof (args as { cycleId: string }).cycleId === 'string') && (!('estimate' in args) || typeof (args as { estimate: number }).estimate === 'number') && (!('dueDate' in args) || typeof (args as { dueDate: string }).dueDate === 'string') && (!('labelIds' in args) || Array.isArray((args as { labelIds: string[] }).labelIds)) && (!('parentId' in args) || typeof (args as { parentId: string }).parentId === 'string') && (!('subscriberIds' in args) || Array.isArray((args as { subscriberIds: string[] }).subscriberIds)) && (!('stateId' in args) || typeof (args as { stateId: string }).stateId === 'string') && (!('templateId' in args) || typeof (args as { templateId: string }).templateId === 'string') && (!('sortOrder' in args) || typeof (args as { sortOrder: number }).sortOrder === 'number') ); }