linear_getComments
Retrieve all comments for a specific issue in Linear, using the issue ID and an optional limit to control the number of comments returned. Simplifies tracking and reviewing discussions within project management.
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
- The handler function for linear_getComments tool. It validates input arguments using isGetCommentsArgs type guard and calls linearService.getComments to fetch comments for the given issue.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; } }; }
- The schema definition for the linear_getComments tool, 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-124 (registration)Registration of the linear_getComments handler in the tools object returned by getHandlers function.linear_getComments: handleGetComments(linearService),
- src/tools/type-guards.ts:408-421 (helper)Type guard function isGetCommentsArgs used in the handler to validate input arguments.* 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') ); }