The Iron Flask is the fantasy equivalent of the ghost traps that were used in Ghostbusters. It is a small portable device that can permanently house/imprison a supernatural creature.
The flask is usually a small round flask stoppered with a brass plug. The plug is invariably covered with arcane glyphs and symbols, while the container itself usually has inlaid runes of silver. But this item also may appear in a few other forms as well, that of an unmarked glass bottle stoppered with a regular cork, or as a brass lamp. These last two forms may often house genies, or other creatures from Arabic myth.
To use the flask you simply take off the cork (or rub it in the case of a lamp), and speak the command word in the presence of a supernatural creature. The flask will then attempt to draw the creature in, but powerful creatures have a good chance of escaping (it is fairly easy to capture genies and elementals, but good luck in trying to get a demon into the flask, even though it technically can hold one). The flask can only hold a single creature at a time, and it is almost impossible to catch the same creature twice, because they are expecting it the second time around.
Taking the stopper off the flask will free the creature trapped inside. If you know the flask's command word, then you can command the creature for a short time (a short time is measured in minutes here, not days). Or alternately you can command it to perform a single task, which may take up to an hour or so. It is wise to get the hell away from any released creatures, or banish them to their point of origin as a final command, because there is nothing that keeps them from attacking once the control wears off.
These flasks will often already have a creature inside when they are discovered. Xorn, elementals, genies, and Rakshasa are the most common inhabitants. The new flask owner will often accidently release the creature before she even figures out what happened. Creatures freed in this manner may exhibit all sorts of reaction from gratitude, to anger, to outright homicidal mania. The flask bearer will not have any control either, since she has freed the creature without speaking the command word.
These flasks are best used one time, and then stored away in a safe place (or buried, abandoned, tossed into the ocean, ecetera). Using the control power is like playing with fire, you do it enough times and you will get burned, So it is just best avoided altogether.
It must be noted that an intelligent game master can easily use one of these as the focus of an entire series of adventures, rather than just using it as another mundane bit of magical equipment. An encounter with one of these can have life altering consequences to anybody who uses it (extraplanar enemies are generally the worst kind, and may persist even after death).
This is only my interpretation of this item, which is based largely upon its use in the older versions of the Dungeons & Dragons series of games. Your Iron Flask may simply be filled with whiskey, so always be sure and read the instructions.