linear_getComments
Retrieve all comments for a specific Linear issue to track discussions and updates, with configurable limits for efficient review.
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 that implements the core logic for linear_getComments: validates input with isGetCommentsArgs 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; } };
- The MCPToolDefinition for linear_getComments, specifying input (issueId required, optional limit) 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:99-99 (registration)Registration of the linear_getComments tool in the registerToolHandlers function, mapping it to handleGetComments.linear_getComments: handleGetComments(linearService)
- src/tools/type-guards.ts:398-411 (helper)Type guard isGetCommentsArgs for validating tool input arguments (issueId required, limit optional).* 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") ); }