diff --git a/index.ts b/index.ts index b0ed0a2..d995ff3 100644 --- a/index.ts +++ b/index.ts @@ -25,6 +25,7 @@ interface CreateIssueArgs { description?: string; priority?: number; status?: string; + parentId?: string; } interface UpdateIssueArgs { @@ -283,7 +284,8 @@ class LinearMCPClient { teamId: args.teamId, description: args.description, priority: args.priority, - stateId: args.status + stateId: args.status, + parentId: args.parentId }); const issue = await issuePayload.issue; @@ -523,7 +525,7 @@ class LinearMCPClient { const createIssueTool: Tool = { name: "linear_create_issue", - description: "Creates a new Linear issue with specified details. Use this to create tickets for tasks, bugs, or feature requests. Returns the created issue's identifier and URL. Required fields are title and teamId, with optional description, priority (0-4, where 0 is no priority and 1 is urgent), and status.", + description: "Creates a new Linear issue with specified details. Use this to create tickets for tasks, bugs, or feature requests. Returns the created issue's identifier and URL. Required fields are title and teamId, with optional description, priority (0-4, where 0 is no priority and 1 is urgent), status, and parentId for creating sub-issues.", inputSchema: { type: "object", properties: { @@ -531,7 +533,8 @@ const createIssueTool: Tool = { teamId: { type: "string", description: "Team ID" }, description: { type: "string", description: "Issue description" }, priority: { type: "number", description: "Priority (0-4)" }, - status: { type: "string", description: "Issue status" } + status: { type: "string", description: "Issue status" }, + parentId: { type: "string", description: "Optional parent issue ID to create this as a sub-issue" } }, required: ["title", "teamId"] } @@ -956,6 +959,7 @@ async function main() { case "linear_create_issue": { const validatedArgs = CreateIssueArgsSchema.parse(args); const issue = await linearClient.createIssue(validatedArgs); + return { content: [{ type: "text", @@ -968,6 +972,7 @@ async function main() { case "linear_update_issue": { const validatedArgs = UpdateIssueArgsSchema.parse(args); const issue = await linearClient.updateIssue(validatedArgs); + return { content: [{ type: "text", @@ -983,11 +988,10 @@ async function main() { return { content: [{ type: "text", - text: `Found ${issues.length} issues:\n${ - issues.map((issue: LinearIssueResponse) => - `- ${issue.identifier}: ${issue.title}\n Priority: ${issue.priority || 'None'}\n Status: ${issue.status || 'None'}\n ${issue.url}` - ).join('\n') - }`, + text: `Found ${issues.length} issues:\n${issues.map((issue: LinearIssueResponse) => + `- ${issue.identifier}: ${issue.title}\n Priority: ${issue.priority || 'None'}\n Status: ${issue.status || 'None'}\n ${issue.url}` + ).join('\n') + }`, metadata: baseResponse }] }; @@ -1000,11 +1004,10 @@ async function main() { return { content: [{ type: "text", - text: `Found ${issues.length} issues:\n${ - issues.map((issue: LinearIssueResponse) => - `- ${issue.identifier}: ${issue.title}\n Priority: ${issue.priority || 'None'}\n Status: ${issue.stateName}\n ${issue.url}` - ).join('\n') - }`, + text: `Found ${issues.length} issues:\n${issues.map((issue: LinearIssueResponse) => + `- ${issue.identifier}: ${issue.title}\n Priority: ${issue.priority || 'None'}\n Status: ${issue.stateName}\n ${issue.url}` + ).join('\n') + }`, metadata: baseResponse }] };