diff --git a/README.md b/README.md index e6511fd..b631f00 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,11 @@ npx @smithery/cli install linear-mcp-server --client claude - `createAsUser` (string): Custom username - `displayIconUrl` (string): Custom avatar URL +6. **`linear_get_issue`**: Get detailed information about a specific issue + - Required inputs: + - `id` (string): Issue ID to retrieve + - Returns detailed issue information including title, description, priority, status, assignee, team, and URL + ### Resources - `linear-issue:///{issueId}` - View individual issue details @@ -110,6 +115,8 @@ Some example prompts you can use with Claude Desktop to interact with Linear: 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 +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 + ## Development 1. Install dependencies: diff --git a/index.ts b/index.ts index b0ed0a2..046b0af 100644 --- a/index.ts +++ b/index.ts @@ -616,6 +616,18 @@ const addCommentTool: Tool = { } }; +const getIssueTool: Tool = { + name: "linear_get_issue", + 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.", + inputSchema: { + type: "object", + properties: { + id: { type: "string", description: "Issue ID" } + }, + required: ["id"] + } +}; + const resourceTemplates: ResourceTemplate[] = [ { uriTemplate: "linear-issue:///{issueId}", @@ -801,6 +813,10 @@ const AddCommentArgsSchema = z.object({ displayIconUrl: z.string().optional().describe("Optional avatar URL for the comment") }); +const GetIssueArgsSchema = z.object({ + id: z.string().describe("Issue ID") +}); + async function main() { try { dotenv.config(); @@ -904,7 +920,7 @@ async function main() { }); server.setRequestHandler(ListToolsRequestSchema, async () => ({ - tools: [createIssueTool, updateIssueTool, searchIssuesTool, getUserIssuesTool, addCommentTool] + tools: [createIssueTool, updateIssueTool, searchIssuesTool, getUserIssuesTool, addCommentTool, getIssueTool] })); server.setRequestHandler(ListResourceTemplatesRequestSchema, async () => { @@ -1023,6 +1039,19 @@ async function main() { }; } + case "linear_get_issue": { + const validatedArgs = GetIssueArgsSchema.parse(args); + const issue = await linearClient.getIssue(validatedArgs.id); + + return { + content: [{ + type: "text", + 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}`, + metadata: baseResponse + }] + }; + } + default: throw new Error(`Unknown tool: ${name}`); } diff --git a/package-lock.json b/package-lock.json index 93a87b6..ac4ac2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "linear-mcp-server", "version": "0.1.0", + "license": "MIT", "dependencies": { "@linear/sdk": "^33.0.0", "@modelcontextprotocol/sdk": "^1.0.3",