linear_getComments
Retrieve all comments for a specific Linear issue to track discussions and feedback. Use the issue ID to fetch comments with optional limit control.
Instructions
Get all comments for an issue
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueId | Yes | ID or identifier of the issue to get comments from (e.g., ABC-123) | |
| limit | No | Maximum number of comments to return (default: 25) |
Implementation Reference
- Handler function for linear_getComments tool. Validates input using isGetCommentsArgs type guard and delegates to LinearService.getComments.export function handleGetComments(linearService: LinearService) { return async (args: unknown) => { try { if (!isGetCommentsArgs(args)) { throw new Error('Invalid arguments for getComments'); } return await linearService.getComments(args.issueId, args.limit); } catch (error) { logError('Error getting comments for issue', error); throw error; } }; }
- Tool schema definition for linear_getComments, including input and output schemas.export const getCommentsToolDefinition: MCPToolDefinition = { name: 'linear_getComments', description: 'Get all comments for an issue', input_schema: { type: 'object', properties: { issueId: { type: 'string', description: 'ID or identifier of the issue to get comments from (e.g., ABC-123)', }, limit: { type: 'number', description: 'Maximum number of comments to return (default: 25)', }, }, required: ['issueId'], }, output_schema: { type: 'array', items: { type: 'object', properties: { id: { type: 'string' }, body: { type: 'string' }, createdAt: { type: 'string' }, user: { type: 'object', properties: { id: { type: 'string' }, name: { type: 'string' }, }, }, url: { type: 'string' }, }, }, }, };
- src/tools/handlers/index.ts:124-125 (registration)Registration of the linear_getComments tool handler in the registerToolHandlers function.linear_getComments: handleGetComments(linearService), };
- src/tools/type-guards.ts:407-421 (helper)Type guard function isGetCommentsArgs used in the handler for input validation./** * Type guard for linear_getComments tool arguments */ export function isGetCommentsArgs(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') ); }