
Dana K. answered 05/13/19
College student tutoring language, science, and math
"Li ho messi in tasca" is correct. The reason for this is that the object referred to by "li" is missing, so it is standard to change the ending of the participle to match it to support this pronoun. When you use the participle in a sentence as the verb, for example, "Ho messo i pezzi in tasca" then it is not necessary. When a direct object pronoun is used, then the participle's ending must change to reflect that.
For a new example, try
"I boiled the farfalle" : "Ho bollato le farfalle."
"I boiled them" : "Le ho bollate."
Similarly,
"I made the cake" : "Ho preparato la torta"
"I made it" : "L'ho preparata"
The "La ho" gets combined for speaking reasons, and in this case it is extra important to change the ending of the participle to show that the pronoun is indeed feminine and plural, to make it more clear what the object is.