list_issues
Retrieve Linear issues with filters for team, assignee, or status to manage project tasks effectively.
Instructions
List issues with optional filters
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| teamId | No | Filter by team ID (optional) | |
| assigneeId | No | Filter by assignee ID (optional) | |
| status | No | Filter by status (optional) | |
| first | No | Number of issues to return (default: 50) |
Implementation Reference
- src/index.ts:288-324 (handler)The main handler function for the 'list_issues' tool. It parses input arguments, constructs a filter for team, assignee, and status, queries the Linear API for issues, formats the results with additional details like status and assignee names, and returns the data as a JSON string in the MCP response format.case "list_issues": { const args = request.params.arguments as unknown as ListIssuesArgs; const filter: Record<string, any> = {}; if (args?.teamId) filter.team = { id: { eq: args.teamId } }; if (args?.assigneeId) filter.assignee = { id: { eq: args.assigneeId } }; if (args?.status) filter.state = { name: { eq: args.status } }; const issues = await linearClient.issues({ first: args?.first ?? 50, filter, }); const formattedIssues = await Promise.all( issues.nodes.map(async (issue) => { const state = await issue.state; const assignee = await issue.assignee; return { id: issue.id, title: issue.title, status: state ? await state.name : "Unknown", assignee: assignee ? assignee.name : "Unassigned", priority: issue.priority, url: issue.url, }; }) ); return { content: [ { type: "text", text: JSON.stringify(formattedIssues, null, 2), }, ], }; }
- src/index.ts:103-123 (schema)JSON schema defining the input parameters for the 'list_issues' tool, used for validation in MCP tool calls.inputSchema: { type: "object", properties: { teamId: { type: "string", description: "Filter by team ID (optional)", }, assigneeId: { type: "string", description: "Filter by assignee ID (optional)", }, status: { type: "string", description: "Filter by status (optional)", }, first: { type: "number", description: "Number of issues to return (default: 50)", }, }, },
- src/index.ts:100-124 (registration)Registration of the 'list_issues' tool in the ListToolsRequestSchema handler, specifying name, description, and input schema.{ name: "list_issues", description: "List issues with optional filters", inputSchema: { type: "object", properties: { teamId: { type: "string", description: "Filter by team ID (optional)", }, assigneeId: { type: "string", description: "Filter by assignee ID (optional)", }, status: { type: "string", description: "Filter by status (optional)", }, first: { type: "number", description: "Number of issues to return (default: 50)", }, }, }, },
- src/index.ts:46-54 (registration)Capabilities declaration indicating support for the 'list_issues' tool among others.tools: { create_issue: true, list_issues: true, update_issue: true, list_teams: true, list_projects: true, search_issues: true, get_issue: true, },
- src/index.ts:230-235 (schema)TypeScript type definition for 'ListIssuesArgs' used for type casting input arguments in the handler.type ListIssuesArgs = { teamId?: string; assigneeId?: string; status?: string; first?: number; };