@@ -64,6 +64,10 @@ func (s *MCPGoServer) registerTools() {
6464 s .registerDeletePlanTool ()
6565 s .registerUpdatePlanStatusTool ()
6666 s .registerListPlansByStatusTool ()
67+
68+ // Plan notes tools
69+ s .registerUpdatePlanNotesTool ()
70+ s .registerGetPlanNotesTool ()
6771
6872 // Task tools
6973 s .registerCreateTaskTool ()
@@ -76,6 +80,10 @@ func (s *MCPGoServer) registerTools() {
7680 s .registerBulkCreateTasksTool ()
7781 s .registerReorderTaskTool ()
7882 s .registerListOrphanedTasksTool ()
83+
84+ // Task notes tools
85+ s .registerUpdateTaskNotesTool ()
86+ s .registerGetTaskNotesTool ()
7987}
8088
8189// Plan tools implementation
@@ -94,6 +102,9 @@ func (s *MCPGoServer) registerCreatePlanTool() {
94102 mcp .WithString ("description" ,
95103 mcp .Description ("Detailed description of the feature's goals, requirements, and scope (optional)" ),
96104 ),
105+ mcp .WithString ("notes" ,
106+ mcp .Description ("Initial Markdown-formatted notes for the plan (optional)" ),
107+ ),
97108 )
98109
99110 s .server .AddTool (tool , func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
@@ -109,13 +120,28 @@ func (s *MCPGoServer) registerCreatePlanTool() {
109120 }
110121
111122 description := request .GetString ("description" , "no description provided" )
123+ notes := request .GetString ("notes" , "" )
112124
113125 // Create the plan
114126 plan , err := s .planRepo .Create (ctx , applicationID , name , description )
115127 if err != nil {
116128 return mcp .NewToolResultError (fmt .Sprintf ("Failed to create plan: %v" , err )), nil
117129 }
118130
131+ // If notes were provided, update them
132+ if notes != "" {
133+ err = s .planRepo .UpdateNotes (ctx , plan .ID , notes )
134+ if err != nil {
135+ return mcp .NewToolResultError (fmt .Sprintf ("Failed to set initial notes: %v" , err )), nil
136+ }
137+
138+ // Refresh plan to include notes
139+ plan , err = s .planRepo .Get (ctx , plan .ID )
140+ if err != nil {
141+ return mcp .NewToolResultError (fmt .Sprintf ("Failed to refresh plan: %v" , err )), nil
142+ }
143+ }
144+
119145 planJson , err := json .Marshal (plan )
120146 if err != nil {
121147 return mcp .NewToolResultError (fmt .Sprintf ("Failed to marshal plan: %v" , err )), nil
@@ -277,6 +303,9 @@ func (s *MCPGoServer) registerUpdatePlanTool() {
277303 mcp .WithString ("description" ,
278304 mcp .Description ("New plan description (optional)" ),
279305 ),
306+ mcp .WithString ("notes" ,
307+ mcp .Description ("New Markdown-formatted notes (optional)" ),
308+ ),
280309 )
281310
282311 s .server .AddTool (tool , func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
@@ -301,6 +330,18 @@ func (s *MCPGoServer) registerUpdatePlanTool() {
301330 if description != plan .Description {
302331 plan .Description = description
303332 }
333+
334+ // Check if notes are provided
335+ notes := request .GetString ("notes" , "" )
336+ if notes != "" {
337+ // Update notes separately using the dedicated method
338+ err = s .planRepo .UpdateNotes (ctx , id , notes )
339+ if err != nil {
340+ return mcp .NewToolResultError (fmt .Sprintf ("Failed to update notes: %v" , err )), nil
341+ }
342+ // Update plan.Notes for the response
343+ plan .Notes = notes
344+ }
304345
305346 // Save the updated plan
306347 err = s .planRepo .Update (ctx , plan )
@@ -399,6 +440,9 @@ func (s *MCPGoServer) registerCreateTaskTool() {
399440 mcp .Description ("Importance and urgency of this task in the overall feature implementation plan (optional, defaults to 'medium')" ),
400441 mcp .Enum ("low" , "medium" , "high" ),
401442 ),
443+ mcp .WithString ("notes" ,
444+ mcp .Description ("Initial Markdown-formatted notes for the task (optional)" ),
445+ ),
402446 )
403447
404448 s .server .AddTool (tool , func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
@@ -413,6 +457,7 @@ func (s *MCPGoServer) registerCreateTaskTool() {
413457 }
414458
415459 description := request .GetString ("description" , "no description provided" )
460+ notes := request .GetString ("notes" , "" )
416461
417462 priorityStr := request .GetString ("priority" , string (models .TaskPriorityMedium ))
418463 priority := models .TaskPriority (priorityStr )
@@ -422,6 +467,20 @@ func (s *MCPGoServer) registerCreateTaskTool() {
422467 return mcp .NewToolResultError (fmt .Sprintf ("Failed to create task: %v" , err )), nil
423468 }
424469
470+ // If notes were provided, update them
471+ if notes != "" {
472+ err = s .taskRepo .UpdateNotes (ctx , task .ID , notes )
473+ if err != nil {
474+ return mcp .NewToolResultError (fmt .Sprintf ("Failed to set initial notes: %v" , err )), nil
475+ }
476+
477+ // Refresh task to include notes
478+ task , err = s .taskRepo .Get (ctx , task .ID )
479+ if err != nil {
480+ return mcp .NewToolResultError (fmt .Sprintf ("Failed to refresh task: %v" , err )), nil
481+ }
482+ }
483+
425484 taskJson , err := json .Marshal (task )
426485 if err != nil {
427486 return mcp .NewToolResultError (fmt .Sprintf ("Failed to marshal task: %v" , err )), nil
@@ -538,6 +597,9 @@ func (s *MCPGoServer) registerUpdateTaskTool() {
538597 mcp .Description ("New task priority (optional)" ),
539598 mcp .Enum ("low" , "medium" , "high" ),
540599 ),
600+ mcp .WithString ("notes" ,
601+ mcp .Description ("New Markdown-formatted notes (optional)" ),
602+ ),
541603 )
542604
543605 s .server .AddTool (tool , func (ctx context.Context , request mcp.CallToolRequest ) (* mcp.CallToolResult , error ) {
@@ -569,6 +631,18 @@ func (s *MCPGoServer) registerUpdateTaskTool() {
569631 priorityStr := request .GetString ("priority" , string (task .Priority ))
570632 task .Priority = models .TaskPriority (priorityStr )
571633
634+ // Check if notes are provided
635+ notes := request .GetString ("notes" , "" )
636+ if notes != "" {
637+ // Update notes separately using the dedicated method
638+ err = s .taskRepo .UpdateNotes (ctx , id , notes )
639+ if err != nil {
640+ return mcp .NewToolResultError (fmt .Sprintf ("Failed to update notes: %v" , err )), nil
641+ }
642+ // Update task.Notes for the response
643+ task .Notes = notes
644+ }
645+
572646 // Save the updated task
573647 err = s .taskRepo .Update (ctx , task )
574648 if err != nil {
0 commit comments