When Aladdin and his friends pick up a camel for the Sultan, they see a giant sand worm heading for the palace. Aladdin and the others later find a cart full of Odiferan cheese next to the pool. They see that the worm likes the cheese and Iago makes Genie throw them far away, so the worm can go after them. After getting rid of the worm, Aladdin and Jasmine fly on Carpet to go to Getzistan, with Aladdin worried about Agrabah.
Genie, Iago, and Abu are at the palace dining room. When Genie and Iago argue about saving Agrabah, the parrot tells the jinn that he can use magic just as good as he can. So Genie gives Iago his powers. Iago then shows Genie that he can use magic better than he can by zapping Abu to have the monkey turn things into treasure whenever he touches them, which makes the jinn jealous.
The parrot then goes to a farm and gives water to two farmers. The Sultan tells Genie that Iago gave Agrabah a river, making Genie even more jealous. Iago says that he's going to make it rain in the city. The parrot then just gives everyone free food and the city is having a feast. He later puts Genie in a dunk tank so that the city can win rubies. On a rainy night, Genie is sitting on a bank of the new river next to a donkey, looking at a photo album. He is upset about Iago using magic better than him.
The next morning, the city is angry at Iago for making it rain because it made a flood, it made the two farmers lose their crops, and it also made Farouk lose his job. Abu also gets angry at Iago because he's tired of making everything he touches turn into treasure due to hunger. Then the sand worm from earlier starts attacking Agrabah after smelling the leftover food from the previous feast. Iago tries to fight it, but fails. So he goes to Genie for help. The worm eats Iago and Genie and while they're inside its mouth, Genie makes Iago pull his fingers, giving the jinn his powers back. After the worm spits the two out, Genie makes the food go "down the drain" and the worm follows them.
Genie then turns Agrabah back to normal. A little while later, Aladdin, Jasmine, and Carpet return and see Agrabah looking normal but empty. Iago is at the dunk tank with the entire city waiting in line to take a shot.