Valbuena, 33, an infielder, played for the Seattle Mariners, the Cleveland Indians, the Chicago Cubs, the Houston Astros and the Los Angeles Angels.

Never a star, he contributed mostly off the bench. He hit 25 home runs for the Astros in 2015, and his best batting average was .260 the next year.

He was released by the Angels in August after hitting .199.

“I will miss Luis’s banter, smile, genuine love for his teammates and, of course, his bat flips,” Astros Manager A. J. Hinch said.

Castillo, 37, played as an infielder in the majors from 2004 to 2008 with the Pittsburgh Pirates, the San Francisco Giants and the Astros. He moved on to play for teams in Taiwan and Japan.

“Luis was always smiling and was one of the happiest players in baseball,” Astros General Manager Jeff Luhnow said.