Apparatus (450) is provided including an electrode (460) and an implantation tool (458) configured to be passed into an abdominal cavity of a patient, and to insert the electrode into a gastric wall of the patient, generally in parallel to the gastric wall. Other embodiments are also described.