Skip to content

Commit a976e7e

Browse files
Joshua OluikpeJoshua Oluikpe
authored andcommitted
feat: add a new tool to get issue by id
1 parent 5e2cb62 commit a976e7e

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ npx @smithery/cli install linear-mcp-server --client claude
8888
- `createAsUser` (string): Custom username
8989
- `displayIconUrl` (string): Custom avatar URL
9090

91+
6. **`linear_get_issue`**: Get detailed information about a specific issue
92+
- Required inputs:
93+
- `id` (string): Issue ID to retrieve
94+
- Returns detailed issue information including title, description, priority, status, assignee, team, and URL
95+
9196
### Resources
9297

9398
- `linear-issue:///{issueId}` - View individual issue details
@@ -110,6 +115,8 @@ Some example prompts you can use with Claude Desktop to interact with Linear:
110115

111116
5. "What's the current workload for the mobile team?" → combine `linear-team:///{teamId}/issues` and `search_issues` to analyze issue distribution and priorities across the mobile team
112117

118+
6. "Get me the full details of issue FOX-1701" → use `linear_get_issue` with the issue ID to retrieve complete information about a specific issue including its current status, assignee, and description
119+
113120
## Development
114121

115122
1. Install dependencies:

index.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,18 @@ const addCommentTool: Tool = {
616616
}
617617
};
618618

619+
const getIssueTool: Tool = {
620+
name: "linear_get_issue",
621+
description: "Retrieves a specific Linear issue by its ID. Returns detailed information about the issue including title, description, priority, status, assignee, team, and URL. Use this to get full details about a specific issue when you have its ID.",
622+
inputSchema: {
623+
type: "object",
624+
properties: {
625+
id: { type: "string", description: "Issue ID" }
626+
},
627+
required: ["id"]
628+
}
629+
};
630+
619631
const resourceTemplates: ResourceTemplate[] = [
620632
{
621633
uriTemplate: "linear-issue:///{issueId}",
@@ -801,6 +813,10 @@ const AddCommentArgsSchema = z.object({
801813
displayIconUrl: z.string().optional().describe("Optional avatar URL for the comment")
802814
});
803815

816+
const GetIssueArgsSchema = z.object({
817+
id: z.string().describe("Issue ID")
818+
});
819+
804820
async function main() {
805821
try {
806822
dotenv.config();
@@ -904,7 +920,7 @@ async function main() {
904920
});
905921

906922
server.setRequestHandler(ListToolsRequestSchema, async () => ({
907-
tools: [createIssueTool, updateIssueTool, searchIssuesTool, getUserIssuesTool, addCommentTool]
923+
tools: [createIssueTool, updateIssueTool, searchIssuesTool, getUserIssuesTool, addCommentTool, getIssueTool]
908924
}));
909925

910926
server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => {
@@ -1023,6 +1039,19 @@ async function main() {
10231039
};
10241040
}
10251041

1042+
case "linear_get_issue": {
1043+
const validatedArgs = GetIssueArgsSchema.parse(args);
1044+
const issue = await linearClient.getIssue(validatedArgs.id);
1045+
1046+
return {
1047+
content: [{
1048+
type: "text",
1049+
text: `Issue Details:\nID: ${issue.identifier}\nTitle: ${issue.title}\nDescription: ${issue.description || 'No description'}\nPriority: ${issue.priority || 'None'}\nStatus: ${issue.status || 'None'}\nAssignee: ${issue.assignee || 'Unassigned'}\nTeam: ${issue.team || 'No team'}\nURL: ${issue.url}`,
1050+
metadata: baseResponse
1051+
}]
1052+
};
1053+
}
1054+
10261055
default:
10271056
throw new Error(`Unknown tool: ${name}`);
10281057
}

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)