The 27-year-old Ramirez, who made seven appearances for the Mariners this season, was immediately optioned to Triple-A Columbus.
Ramirez went 1-0 with a 7.56 ERA before he was designated for assignment May 13. He also pitched in four games for Triple-A Tacoma.
Ramirez has spent part of the past three seasons with Seattle, which got him in the 2019 winter meetings draft after he spent four seasons in Houston's organization.
To make room on their 40-man roster for Ramirez, the Guardians transferred reliever James Karinchak to the 60-day injured list. He has been slowed this season by a strained shoulder muscle.
Cleveland was off Monday. The Guardians open a two-game series Tuesday against the Cincinnati Reds.