In this paper, we study a class of twisted generalized Reed-Solomon (TGRS) codes with general l twists. A sufficient and necessary condition for the TGRS codes to be MDS or l-MDS (l