Shaggy and Scooby-Doo travel to Arabia via magic carpet for their jobs as royal food tasters for the Caliph. Due to their addiction to food, they eat all of the Caliph's lunch (they're supposed to taste it to see if it's poisoned) and are in big trouble. They are chased by big bumbling guards and they hide in the Caliph's harem. There, Scooby hides and Shaggy dresses like a woman, but the near sighted Caliph (who lost his glasses) finds him attractive and claims to have found the right girl to be his wife. So, to bore the Caliph to sleep, Shaggy tells a dull story, which is "Aliyah-Din and the Magic Lamp" (a retelling of Aladdin).
It features a kind hearted peasant girl named Aliyah-Din who while washing her clothes in a river, is spotted by the prince; afraid, Aliyah-Din flees but drops a scarf which the prince picks up- it's obvious he's fallen in love.
Aliyah-Din is used by Haman the villain to get a magic lamp, which contains Yogi the hungry genie bear and Boo-Boo the genie-in-training. Aliyah-Din realizes what is afoot and denies Haman the lamp but is subsequently trapped in the cave. Back at the palace, an event is being held for all noble women in the land to come and try to win the prince's heart, but the prince is only interested in Aliyah-Din. Haman puts the prince under a sleep spell and disguises himself as the prince.
Aliyah-Din who has also fallen for the prince wishes she could be a princess and attends the event. The prince coaxes the lamp from her and becomes a powerful giant, Aliyah-Din defeats Haman, becomes a princess, and wins the prince's heart.
When Shaggy finishes the story, the Caliph is impressed and wants to marry him, so Shaggy tells ANOTHER dull story, a remix of "Sinbad the Sailor" with Magilla Gorilla as Sinbad. He thinks a rickety (constantly-sinking) boat is a cruise ship and the evil captain on board wants to use Magilla as his crew, to steal jewels, a rhuk (prehistoric bird) egg and a golden toothbrush from a high-class cyclops. But Magilla defeats the captain.
Then Shaggy is about to escape, but they decide to start the ceremony right away. When the wedding cake arrives, Shaggy pigs out and his ruse is discovered. He and Scooby are asked to be the royal storytellers, and the duo accept as well as being the royal food tasters again.