linear_archiveIssue
Archive completed or inactive issues in Linear to maintain an organized project workspace by removing them from active views while preserving their data.
Instructions
Archive an issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueId | Yes | ID or identifier of the issue to archive (e.g., ABC-123) |
Implementation Reference
- The main handler function for the linear_archiveIssue tool. It validates the input arguments using isArchiveIssueArgs type guard and calls the LinearService.archiveIssue method to archive the specified issue./** * Handler for archiving an issue */ export function handleArchiveIssue(linearService: LinearService) { return async (args: unknown) => { try { if (!isArchiveIssueArgs(args)) { throw new Error('Invalid arguments for archiveIssue'); } return await linearService.archiveIssue(args.issueId); } catch (error) { logError('Error archiving issue', error); throw error; } }; }
- The MCP tool definition for linear_archiveIssue, including the name, description, input schema (requires issueId), and output schema.export const archiveIssueToolDefinition: MCPToolDefinition = { name: 'linear_archiveIssue', description: 'Archive an issue', input_schema: { type: 'object', properties: { issueId: { type: 'string', description: 'ID or identifier of the issue to archive (e.g., ABC-123)', }, }, required: ['issueId'], }, output_schema: { type: 'object', properties: { success: { type: 'boolean' }, message: { type: 'string' }, }, }, };
- src/tools/handlers/index.ts:117-125 (registration)Registration of the linear_archiveIssue handler within the registerToolHandlers function, mapping the tool name to handleArchiveIssue(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:328-340 (helper)Type guard function isArchiveIssueArgs used in the handler to validate input arguments for the linear_archiveIssue tool./** * Type guard for linear_archiveIssue tool arguments */ export function isArchiveIssueArgs(args: unknown): args is { issueId: string; } { return ( typeof args === 'object' && args !== null && 'issueId' in args && typeof (args as { issueId: string }).issueId === 'string' ); }