linear_getIssueHistory
Retrieve the history of changes made to a specific issue in Linear. Provide the issue ID to view its timeline of updates, with an optional limit on the number of events returned.
Instructions
Get the history of changes made to an issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueId | Yes | ID or identifier of the issue (e.g., ABC-123) | |
| limit | No | Maximum number of history events to return (default: 10) |
Implementation Reference
- The primary handler function for the 'linear_getIssueHistory' tool. It validates the input arguments using the type guard and calls the LinearService to retrieve the issue history.export function handleGetIssueHistory(linearService: LinearService) { return async (args: unknown) => { try { if (!isGetIssueHistoryArgs(args)) { throw new Error('Invalid arguments for getIssueHistory'); } return await linearService.getIssueHistory(args.issueId, args.limit); } catch (error) { logError('Error getting issue history', error); throw error; } }; }
- Tool definition including input and output schemas for 'linear_getIssueHistory'.export const getIssueHistoryToolDefinition: MCPToolDefinition = { name: 'linear_getIssueHistory', description: 'Get the history of changes made to an issue', input_schema: { type: 'object', properties: { issueId: { type: 'string', description: 'ID or identifier of the issue (e.g., ABC-123)', }, limit: { type: 'number', description: 'Maximum number of history events to return (default: 10)', }, }, required: ['issueId'], }, output_schema: { type: 'object', properties: { issueId: { type: 'string' }, identifier: { type: 'string' }, history: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, createdAt: { type: 'string' }, actor: { type: 'object' }, type: { type: 'string' }, from: { type: 'string' }, to: { type: 'string' }, }, }, }, }, }, };
- src/tools/handlers/index.ts:121-121 (registration)Registration of the tool handler in the map returned by registerToolHandlers.linear_getIssueHistory: handleGetIssueHistory(linearService),
- src/tools/type-guards.ts:394-405 (schema)Type guard function for validating input arguments to the 'linear_getIssueHistory' tool.export function isGetIssueHistoryArgs(args: unknown): args is { issueId: string; limit?: number; } { return ( typeof args === 'object' && args !== null && 'issueId' in args && typeof (args as { issueId: string }).issueId === 'string' && (!('limit' in args) || typeof (args as { limit: number }).limit === 'number') ); }