linear_getIssues
Retrieve a list of recent issues from Linear project management system, with an optional limit on the number of issues to fetch. Simplifies issue tracking and project monitoring.
Instructions
Get a list of recent issues from Linear
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of issues to return (default: 10) |
Implementation Reference
- The handler function that implements the core logic for the 'linear_getIssues' tool. It validates the input using a type guard and delegates to LinearService.getIssues./** * Handler for getting issues */ export function handleGetIssues(linearService: LinearService) { return async (args: unknown) => { try { if (!isGetIssuesArgs(args)) { throw new Error('Invalid arguments for getIssues'); } return await linearService.getIssues(args.limit); } catch (error) { logError('Error getting issues', error); throw error; } }; }
- The schema definition specifying input (optional limit) and detailed output schema for issues returned by 'linear_getIssues'./** * Tool definition for getting issues */ export const getIssuesToolDefinition: MCPToolDefinition = { name: 'linear_getIssues', description: 'Get a list of recent issues from Linear', input_schema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of issues to return (default: 10)', }, }, }, output_schema: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, identifier: { type: 'string' }, title: { type: 'string' }, description: { type: 'string' }, state: { type: 'string' }, priority: { type: 'number' }, estimate: { type: 'number' }, dueDate: { type: 'string' }, team: { type: 'object' }, assignee: { type: 'object' }, project: { type: 'object' }, cycle: { type: 'object' }, parent: { type: 'object' }, labels: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, color: { type: 'string' }, }, }, }, sortOrder: { type: 'number' }, createdAt: { type: 'string' }, updatedAt: { type: 'string' }, url: { type: 'string' }, }, }, }, };
- src/tools/handlers/index.ts:64-126 (registration)The registration function that maps the tool name 'linear_getIssues' to its handler function handleGetIssues, part of the overall tool handlers registry.export function registerToolHandlers(linearService: LinearService) { return { // User tools linear_getViewer: handleGetViewer(linearService), linear_getOrganization: handleGetOrganization(linearService), linear_getUsers: handleGetUsers(linearService), linear_getLabels: handleGetLabels(linearService), // Team tools linear_getTeams: handleGetTeams(linearService), linear_getWorkflowStates: handleGetWorkflowStates(linearService), // Project tools linear_getProjects: handleGetProjects(linearService), linear_createProject: handleCreateProject(linearService), // Project Management tools linear_updateProject: handleUpdateProject(linearService), linear_addIssueToProject: handleAddIssueToProject(linearService), linear_getProjectIssues: handleGetProjectIssues(linearService), // Cycle Management tools linear_getCycles: handleGetCycles(linearService), linear_getActiveCycle: handleGetActiveCycle(linearService), linear_addIssueToCycle: handleAddIssueToCycle(linearService), // Initiative Management tools linear_getInitiatives: getInitiativesHandler(linearService), linear_getInitiativeById: getInitiativeByIdHandler(linearService), linear_createInitiative: createInitiativeHandler(linearService), linear_updateInitiative: updateInitiativeHandler(linearService), linear_archiveInitiative: archiveInitiativeHandler(linearService), linear_unarchiveInitiative: unarchiveInitiativeHandler(linearService), linear_deleteInitiative: deleteInitiativeHandler(linearService), linear_getInitiativeProjects: getInitiativeProjectsHandler(linearService), linear_addProjectToInitiative: addProjectToInitiativeHandler(linearService), linear_removeProjectFromInitiative: removeProjectFromInitiativeHandler(linearService), // Issue tools linear_getIssues: handleGetIssues(linearService), linear_getIssueById: handleGetIssueById(linearService), linear_searchIssues: handleSearchIssues(linearService), linear_createIssue: handleCreateIssue(linearService), linear_updateIssue: handleUpdateIssue(linearService), linear_createComment: handleCreateComment(linearService), linear_addIssueLabel: handleAddIssueLabel(linearService), linear_removeIssueLabel: handleRemoveIssueLabel(linearService), // New Issue Management tools linear_assignIssue: handleAssignIssue(linearService), linear_subscribeToIssue: handleSubscribeToIssue(linearService), linear_convertIssueToSubtask: handleConvertIssueToSubtask(linearService), linear_createIssueRelation: handleCreateIssueRelation(linearService), linear_archiveIssue: handleArchiveIssue(linearService), linear_setIssuePriority: handleSetIssuePriority(linearService), linear_transferIssue: handleTransferIssue(linearService), linear_duplicateIssue: handleDuplicateIssue(linearService), linear_getIssueHistory: handleGetIssueHistory(linearService), // Comment Management tools linear_getComments: handleGetComments(linearService), }; }
- src/tools/type-guards.ts:1-10 (helper)Type guard function used by the handler to validate the input arguments for 'linear_getIssues'./** * Type guard for linear_getIssues tool arguments */ export function isGetIssuesArgs(args: unknown): args is { limit?: number } { return ( typeof args === 'object' && args !== null && (!('limit' in args) || typeof (args as { limit: number }).limit === 'number') ); }