Pirates are sword-wielding humanoid enemies that frequent the Ghost Ship Cove. At the end of path A, you have to fight off a swarm of pirates as the boss the area. During the fight, one pirate will come in armed with a magic lamp and will summon the genie to attack you. To prevent this, attack the pirate with the lamp to make him drop it, then you can grab and use it yourself to turn the tides of the battle.
One quest, Release the Genie, requires you to summon the genie three times before winning the boss battle.