Skip to main content
Glama

linear_createIssue

Create new issues in Linear project management with details like title, description, team assignment, priority, due dates, and labels.

Instructions

Create a new issue in Linear

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the issue
descriptionNoDescription of the issue (Markdown supported)
teamIdYesID of the team the issue belongs to
assigneeIdNoID of the user to assign the issue to
priorityNoPriority of the issue (0 = No priority, 1 = Urgent, 2 = High, 3 = Normal, 4 = Low)
projectIdNoID of the project the issue belongs to
cycleIdNoID of the cycle to add the issue to
estimateNoThe estimated complexity/points for the issue
dueDateNoThe date at which the issue is due (YYYY-MM-DD format)
labelIdsNoIDs of the labels to attach to the issue
parentIdNoID of the parent issue (to create as a sub-task)
subscriberIdsNoIDs of the users to subscribe to the issue
stateIdNoID of the workflow state for the issue
templateIdNoID of a template to use for creating the issue
sortOrderNoThe position of the issue in relation to other issues

Implementation Reference

  • The main handler function for the linear_createIssue tool. It validates the input arguments using a type guard and delegates the creation to the LinearService.
    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 schema definition specifying input parameters, required fields, and output format 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" } } } };
  • Registration of the linear_createIssue handler in the tool handlers registry, mapping the tool name to its handler function.
    linear_createIssue: handleCreateIssue(linearService),
  • Type guard function used by the handler to validate and type-check the input arguments for linear_createIssue.
    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") );
  • Core service method that executes the Linear SDK createIssue mutation and formats the response.
    async createIssue(args: { 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; }) { const createdIssue = await this.client.createIssue({ title: args.title, description: args.description, teamId: args.teamId, assigneeId: args.assigneeId, priority: args.priority, projectId: args.projectId, cycleId: args.cycleId, estimate: args.estimate, dueDate: args.dueDate, labelIds: args.labelIds, parentId: args.parentId, subscriberIds: args.subscriberIds, stateId: args.stateId, templateId: args.templateId, sortOrder: args.sortOrder, }); // Access the issue from the payload if (createdIssue.success && createdIssue.issue) { const issueData = await createdIssue.issue; return { id: issueData.id, title: issueData.title, description: issueData.description, url: issueData.url, }; } else { throw new Error('Failed to create issue'); } }

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/wkoutre/linear-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server