The inventors have developed a biocompatible and biodegradable origami robot that can be swallowed to perform simple procedures in the stomach without any incisions or external tethers. Once in the stomach, the robot self-deploys and uses its body to patch a wound, such as an inflammation made by an accidentally swallowed button battery. The inventors have used the origami design to fold and embed the robot in an ice capsule which can be swallowed, carried to the stomach and deployed. It is there actuated by external magnetic fields and guided to the location of the battery where it dislodges the battery from the inflammation site. Using an artificial stomach, the position of the robot was visually observed, though in real clinical applications, Hall-effect sensors, a combination of ultrasound, and X-rays would be employed to determine the position. The ice dissolution approach enhances the probability of a proper attachment, as the magnet steadily reorients itself while the ice melts to maximize connection strength. This approach also reduces the risk of the magnet and the battery magnetically pinching the mucosa. After the battery and the robot are removed from the body through the GI tract, the patient swallows another ice capsule-enclosed-origami robot. This second robot walks across the stomach wall, and patches the inflammation site by releasing a drug to the damaged area as it degrades.