@@ -19,6 +19,8 @@ import { join, dirname } from "path";
19
19
import { fileURLToPath } from "url" ;
20
20
import {
21
21
ApiError ,
22
+ CommentCreate ,
23
+ CommentService ,
22
24
ConfigService ,
23
25
DocCreate ,
24
26
DocService ,
@@ -417,6 +419,28 @@ const DELETE_TASK_TOOL: Tool = {
417
419
} ,
418
420
} ;
419
421
422
+ const ADD_TASK_COMMENT_TOOL : Tool = {
423
+ name : "add_task_comment" ,
424
+ description :
425
+ "Add a comment to an existing task without modifying the task description. Comments support markdown formatting." ,
426
+ inputSchema : {
427
+ type : "object" ,
428
+ properties : {
429
+ taskId : {
430
+ type : "string" ,
431
+ description : "The 12-character alphanumeric ID of the task" ,
432
+ pattern : "^[a-zA-Z0-9]{12}$" ,
433
+ } ,
434
+ text : {
435
+ type : "string" ,
436
+ description :
437
+ "The full content of the comment, which can include markdown formatting." ,
438
+ } ,
439
+ } ,
440
+ required : [ "taskId" , "text" ] ,
441
+ } ,
442
+ } ;
443
+
420
444
const LIST_DOCS_TOOL : Tool = {
421
445
name : "list_docs" ,
422
446
description :
@@ -714,6 +738,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
714
738
GET_TASK_TOOL ,
715
739
UPDATE_TASK_TOOL ,
716
740
DELETE_TASK_TOOL ,
741
+ ADD_TASK_COMMENT_TOOL ,
717
742
LIST_DOCS_TOOL ,
718
743
CREATE_DOC_TOOL ,
719
744
GET_DOC_TOOL ,
@@ -772,6 +797,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
772
797
content : [ { type : "text" , text : JSON . stringify ( task , null , 2 ) } ] ,
773
798
} ;
774
799
}
800
+ case "add_task_comment" : {
801
+ const taskId = getIdValidated ( request . params . arguments . taskId ) ;
802
+ const text = request . params . arguments . text ;
803
+ const commentData = { taskId, text } as CommentCreate ;
804
+ const comment = await CommentService . createComment ( {
805
+ item : commentData ,
806
+ } ) ;
807
+ return {
808
+ content : [ { type : "text" , text : JSON . stringify ( comment , null , 2 ) } ] ,
809
+ } ;
810
+ }
775
811
case "list_docs" : {
776
812
const docs = await DocService . listDocs ( request . params . arguments ) ;
777
813
return {
0 commit comments