Skip to content

Include optional parentId when creating issues #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ interface CreateIssueArgs {
description?: string;
priority?: number;
status?: string;
parentId?: string;
}

interface UpdateIssueArgs {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -523,15 +525,16 @@ 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: {
title: { type: "string", description: "Issue title" },
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"]
}
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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
}]
};
Expand All @@ -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
}]
};
Expand Down