@@ -261,7 +261,7 @@ func NewMCPServer(appConfig *Config) *server.MCPServer {
mcp.Required(),
),
mcp.WithString("area_id",
- mcp.Description("New Area ID for the task. Must be a valid area_id from list_areas_and_goals tool. Only include if moving the task to a different area."),
+ mcp.Description("New Area ID for the task. Must be a valid area_id from list_areas_and_goals tool. Only include if moving the task to a different area. If omitted, the task will remain in its current area."),
),
mcp.WithString("goal_id",
mcp.Description("New Goal ID for the task. Must be a valid goal_id from list_areas_and_goals that belongs to the task's area (current or new). Only include if changing the goal association."),
@@ -200,6 +200,8 @@ func (h *Handlers) HandleUpdateTask(ctx context.Context, request mcp.CallToolReq
} else if !ok && areaIDArg != nil {
return reportMCPError("Invalid type for area_id argument: expected string.")
}
+ // If area_id is not provided or is empty, we don't set it in the updatePayload
+ // This will leave the task in its current area
}
if goalIDArg, exists := arguments["goal_id"]; exists {
@@ -219,6 +221,8 @@ func (h *Handlers) HandleUpdateTask(ctx context.Context, request mcp.CallToolReq
} else if areaIDProvided {
return reportMCPError("Internal error: area_id provided but area details not loaded for goal validation.")
}
+ // If area_id is not provided, we're not moving the task to a different area
+ // In this case, the goal validation should be skipped as we don't know the current area
} else if !ok && goalIDArg != nil {
return reportMCPError("Invalid type for goal_id argument: expected string.")
}