Skip to content

Commit dfa08df

Browse files
authored
Merge pull request #14 from XHR-CONSULTING/main
fix: comment, now supports parent reply
2 parents 202c166 + 05591c7 commit dfa08df

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/services/linear-service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,18 +517,21 @@ export class LinearService {
517517
}
518518
}
519519

520-
async createComment(args: { issueId: string; body: string }) {
520+
async createComment(args: { issueId: string; body: string; parentId?: string }) {
521521
const createdComment = await this.client.createComment({
522522
issueId: args.issueId,
523523
body: args.body,
524+
parentId: args.parentId,
524525
});
525526

526527
if (createdComment.success && createdComment.comment) {
527528
const commentData = await createdComment.comment;
529+
const parent = commentData.parent ? await commentData.parent : null;
528530
return {
529531
id: commentData.id,
530532
body: commentData.body,
531533
url: commentData.url,
534+
parentId: parent?.id,
532535
};
533536
} else {
534537
throw new Error('Failed to create comment');

src/tools/definitions/issue-tools.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ export const updateIssueToolDefinition: MCPToolDefinition = {
367367
*/
368368
export const createCommentToolDefinition: MCPToolDefinition = {
369369
name: 'linear_createComment',
370-
description: 'Add a comment to an issue in Linear',
370+
description: 'Add a comment to an issue in Linear (supports threaded replies)',
371371
input_schema: {
372372
type: 'object',
373373
properties: {
@@ -379,6 +379,10 @@ export const createCommentToolDefinition: MCPToolDefinition = {
379379
type: 'string',
380380
description: 'Text of the comment (Markdown supported)',
381381
},
382+
parentId: {
383+
type: 'string',
384+
description: 'ID of the parent comment to reply to (for threaded comments)',
385+
},
382386
},
383387
required: ['issueId', 'body'],
384388
},
@@ -388,6 +392,7 @@ export const createCommentToolDefinition: MCPToolDefinition = {
388392
id: { type: 'string' },
389393
body: { type: 'string' },
390394
url: { type: 'string' },
395+
parentId: { type: 'string' },
391396
},
392397
},
393398
};

src/tools/type-guards.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,16 @@ export function isUpdateIssueArgs(args: unknown): args is {
187187
export function isCreateCommentArgs(args: unknown): args is {
188188
issueId: string;
189189
body: string;
190+
parentId?: string;
190191
} {
191192
return (
192193
typeof args === 'object' &&
193194
args !== null &&
194195
'issueId' in args &&
195196
typeof (args as { issueId: string }).issueId === 'string' &&
196197
'body' in args &&
197-
typeof (args as { body: string }).body === 'string'
198+
typeof (args as { body: string }).body === 'string' &&
199+
(!('parentId' in args) || typeof (args as { parentId: string }).parentId === 'string')
198200
);
199201
}
200202

0 commit comments

Comments
 (0)