Half the time when good guys get locked in a cell, all of the equipment that they need to escape is in the cell with them. Bedsheets are a favorite for this MacGyvering technique.
When the improvised equipment is awesome enough to deserve screen time of its own, a Forging Scene is inevitably preceding its unveiling. If multiple team members work together, it's an A-Team Montage.
This entry was inspired by the MacGyver episode "Road Not Taken", where MacGyver and his Girl of the Week (actually one of his many ex-girlfriends) were locked in a building somewhere in SE Asia. This room included:
In Gundam SEED Astray, the heroes are locked in a weapons testing dome by a Corrupt Corporate Executive trying to force them to sell their Gundam. Fortunately, they had said Gundam and a pile of salvaged Humongous Mecha with them at the time. So they cobble together a power converter out of the parts, and hook up a Beam Sword to the facility's own power supply so they'd have the power to cut their way out.
Taken to a whole new level in Pokemon 2000. The villain, who has just captured Zapdos, has managed to accidentally catch Ash & Co as well and put them in a cage. Then, breaking all laws of common sense, lets them go as he monologues, free to wander around his makeshift museum with the captured Zapdos and Moltres, seemingly convinced they they would not do something inconvenient, like go and break out the imprisoned birds...
To be fair, he's not much of a villain. Really, the only real difference between what he does compared to Ash & Co is that he didn't capture them to pit them against other pokemon in fights for entertainment.
That, and the fact that his efforts were driving the weather insane, and putting the entire world in danger.
In a Fantastic Four issue, Doctor Doom imprisons Reed Richards behind a magical door locked with (according to Doom) a very basic enchantment that even a beginner magician could break. The room also has a massive library of magical tomes, more than enough to learn how to break the enchantment (again, according to Doom). This is a subversion, though: Reed is completely incompetent when it comes to magic, so the library only serves to taunt him and his limitation. When Reed finally admits his incompetence, it turns out to be the magic words that unlock the door. Apparently Doom never expected Reed to do something that Doom, in his arrogance, would never do.
A different Fantastic Four issue used, and subverted a similar situation to the Lex Luthor one in the Literature section. The confined Zombie Four stage announce that they've made a teleporter made from a ballpoint pen, hair, paper. Zombie Susan just turned them invisible. She lampshades how stupid the guards would be to fall for it. They do.
The origin of Iron Man is a classic example. Capture a brilliant engineer, tell him to create weapons for you, and then leave him alone (save for a scientist who also hates you) with everything he needs to do it? Gee, who could have guessed that was going to backfire on them?
Similar happens in the Secret Invasion maxi-plot in Marvel Comics. Invading Skrulls want to neutralize many heroes. The part for Iron Man involves stranding him in a jungle and frying all his technology remotely. Too bad they literally left him in an abandoned laboratory complex. Oops.
A team of supervillains hired to assassinate Tony ambushed him while he was visiting a junkyard full of abandoned machinery. One villain even pointed out the idiocy of attacking Tony there since Tony is a well-known Gadgeteer Genius who designs high-tech weapons for a living.
Subverted in the famous Silver Age"Imaginary"Superman story, "The Death of Superman" where Lex Luthor claims he has created a cure for cancer in prison and offers to develop it if he has access to a lab. The warden is not buying this and accuses Luthor of getting into a room where he can build yet another tool set to escape. When Superman convinces the warden to let Luthor do his thing, Lex actually does cure cancer. Of course it's all a scheme to make Superman trust him so he can kill him.
In the Silver Age, giving Lex Luthor pretty much anything in prison was a bad idea. In All-Star Superman, a homage to the Silver Age, while on Death Row he creates a robot than reads classics to him... that can speak at a high enough frequecy to dig through solid rock. He later gets the chance to mix a cocktail for his last meal... he mixes a chemical formula that gives him Kryptonian powers for 24 hours. At one point it got so ridiculous that the only thing that they would allow him in prison was pen and paper. He noted to himself that he could break out of prison with just a notepad and a pen, but if he did that, the next time he got locked up the guards wouldn't let him have pen and paper anymore.
Batman is a master of this kind of escape. One Silver Age example involves him escaping from a mill that is rigged to explode using millstones, sacks of rice and a fire hose.
The Creeper: It's also not too good of an idea to lock a scientist in a room with all his medical equipment and the very scientific invention you are trying to steal, one of them being a serum that gives super-strength. And if you really must do that, don't lock any suspicious lemon yellow men in there WITH him.
The Man In Room Five from V for Vendetta is given access to gardening chemicals at Larkhill. He seems to be building a Room Full of Crazy, it turns out he's made Napalm and Mustard Gas.
Parodied in the Norwegian daily comic Eon. MacGyver is seemingly locked inside the bathroom, and comes up with a brilliant escape plan involving a piece of soap, a razor, wire and some other articles, to which the main character responds: "Or we could just open the door." Turns out the door wasn't locked at all.
The Joker. Arkham Asylum keeps trying to give Joker a job or two to do. Letting him into the janitor's closet was a really bad idea.
In Hollow Man, the heroine is trapped in a supply room, which is barred shut by the bad guy. She improvises an electromagnet from wire, metal, and an emergency defibrillator, then uses it to draw the steel bar aside from the other side of the door.
Hollow Man is parodied in Scary Movie 2. Two main characters find themselves locked in a freezer while running from an angry spirit. After a "heartwarming" monologue, the heroine takes a couple of screws, cups, strings, and other extraneous items and somehow manages to create an entire bulldozer, destroying the wall and allowing them to escape.
Spoofed in Shanghai Knights, where Chon Lin is said to have "picked the lock using a deck of rather risqué playing cards. Then scaled the walls with a mop, a fork, and various pilfered undergarments."
Both The Thing from Another World and The Thing (1982) have this occur, except in those cases it's the villain who gets locked in by the heroes (it's locked in a greenhouse in the first version and in a tool shed in the prequel. Here Blair has not been infected however).
In WarGames, the Air Force brings David (Matthew Broderick) to NORAD because he hacked into the missile control system computer. The first example happens when they leave him alone in McKittrick's office where he has access to a computer terminal. Next, they lock him up in the infirmary where he (not surprisingly) finds enough supplies to facilitate a crafty escape using medical supplies and a tape recorder.
In The World Is Not Enough, M is locked in a cage with a clock left on a stool so she'll know when a bomb will kill her (and the rest of the city). The cage is filled with artifacts being excavated from the site, most of which are useless. There is, however, a broom, which she uses to knock over the clock. When the villain comes back, they leave the clock on the cell door instead of setting it back up. M promptly uses the clock to power a tracking chip in her pocket, which they never bothered to search for.
The Fire Nation's stupidity is Turned Up to Eleven in M. Night Shyamalan's The Last Airbender. In the show, they keep Earthbenders imprisoned on a large metal platform far out to sea, where no earth is available for the Earthbenders to use against their captors until they discover that the ship runs on coal. In The Movie, they keep the Earthbenders imprisoned in a quarry. With only a handful of guards keeping the order. Their prison is literally made out of weaponry. The implication is that the Earthbenders are too psychologically broken to fight back in the first place.
Pictured above: in Iron Man 1, Tony Stark is kidnapped and left mostly unsupervised with various parts that are supposed to build a missile. Instead he builds the first version of his Iron Man suit and uses it to escape.
Masters of the Universe uses this trope to create a Hope Spot: Skeletor has captured He-Man and taken him back to Eternia, and has broken the Cosmic Key, stranding the rest of the heroes on Earth...then he grabs the Idiot Ball and leaves the broken Key behind with the rest of the heroes, the Key's inventor, all the spare parts needed to fix the Key, and a guy who can figure out how to set the Key to teleport them all directly into Skeletor's throne room.
In Demolition Man, the museum armory exhibit in San Angeles has a lock-down protocol in case the weapons are stolen or used. All the weapons within are fully-functional and have ammunition, including a cannon. The doors are made of (presumably reinforced) glass. Do the math. Note that this kind of thing is the reason why weapons and ammunition in real life museums are rendered non-functional before they're put on display.
The Kryptonians in Man of Steel lock up Lois Lane in a room on their spaceship that just happens to have a socket that accepts the data key containing Jor-El's downloaded personality that Superman had previously slipped to her.
Subverted in every single Discworld novel that features the principal character getting locked in a cell of some sort; the characters, via narration, complain that their jailers hadn't supplied them with any of the necessary means of escape. A notable example in Monstrous Regiment when the titular regiment is locked in a kitchen - not only does their makeshift cell lack any of the useful weapon-type things one would expect to find in a kitchen (knives, rolling pins, etc), but it also appears to contain no food at all.
Also played straight in the same book, as one of the companions of the protagonist is a pyromaniac and the soldiers helpfully leave them in a room full of flour.
Another Discworld subversion is in The Fifth Elephant, where Vimes is imprisoned by Dwarves and slipped some kind of particularly deadly assassin's weapon with which to take out his guards. It is a subversion, as he correctly reasons that the weapon was only provided so that he could be legitimately executed if he used it (Plus, it's a single-shot weapon, and there's more than one guard), and thus he only knocks the guards unconscious when escaping.
Another example, from Feet of Clay, has a specific Shout Out to MacGyver and/or The A-Team - "some villains are obliging enough to lock you in a warehouse with enough equipment to build a fully functional armoured car".
The Columbo example below was an adaptation of the 87th Precinct novel So Long as You Both Shall Live where the heroine escapes in the same manner (and with the same end result).
A Series of Unfortunate Events had its characters escape from prison with an improbable set of equipment that included the bread they were given to eat. This isn't the only example in the series.
Stephen King's fantasy novel The Eyes of The Dragon has an extremely long sequence of this as its main plot, with the only item used for escape being napkin threads, woven into a rope over three years to climb down a tower. Slightly subverted in that the escape plan has a flaw the budding MacGyver doesn't know about - a long rope made of napkin threads has to be able to hold its own weight as well.
Notably done in the book The Thirty-Nine Steps (1915) by John Buchan, in which the hero blows his way out of a store cupboard using his powers of mining-engineering and a fictional explosive.
In one Modesty Blaise novel, Modesty and Willie are captured by a villain who wants to see if their reputation for inventiveness is deserved before recruiting them. He locks them in a cell but deliberately leaves a means of escape to see if they will discover it. They do, then decide that is too obvious and must be a trap, and proceed to invent their own means of escape. The bad guy is very impressed.
In one of the ShatnerVerse Star Trek novels, Captain Kirk and his allies are separated into pairs and locked into prison cells/holodecks. The doors are not really locked, but the holodeck is programmed to 'keep' the entrance away with every step taken. You can run a mile but never get to it. Thankfully, each prison pair has a super-smarty Vulcan, who figures out that throwing his or her partner at the door will fool the computer. The stunned and bruised partner then opens the door and turns off the holodeck.
Happens in John W. Campbell's novella Who Goes There? with a rare villainous example. In this case the heroes end up locking an alien monster in a shed where it has the equipment to build an escape craft. To their credit the alien was The Virus and they hadn't realized it had gotten the guy they locked in the toolshed.
This is the premise of the short story The Problem of Cell 13. A detective bets his friends that he can escape from a maximum security prison. He does, of course, using things he conveniently finds in his cell. When asked what he would have done if those items had not been there, he smugly states that there were two other ways out. (It is never stated what they were.)
Matthew Hawkwood does it in Rapscallion. The cellar in which he and Lasseur are imprisoned in turns out to contain everything they need to effect an escape.
In The Diamond Age, the bad guys lock Nell in a closet with a working matter compiler.
In Larry Niven's Ringworld's Children, Tunesmith (a super-intelligent Night Person protector) is smart enough to lock Luis Wu out of the stepping disk system in order to keep Luis from escaping, but somehow didn't think it important to lock Luis out of the autokitchen menu. So naturally Luis orders sushi from the autokitchen, a meal that is dispensed alongside a pair of hardwood chopsticks... which Luis promptly uses to hack his way into the stepping disk system and escape.
In one of the Tom Swift books, some villain kidnaps Tom and his father and locks them in a building in the middle of nowhere, with the lab equipment necessary to make some product which the villain want to coerce them to make. They instead fabricate a whole lot of lighter-than-air foam, with which they fill the building and then unbolt it from its foundations.
Subverted for laughs in "The Adventures of Huckleberry Finn" where Jim is shackled to a bedpost and could escape simply by lifting the bed of the ground, but genre savvy Tom Sawyer knows that this is not how it is done in prisoner novels, so instead Jim has to saw his way through the bedpost, so this also subverts genre savvyness per se. Inverted in "The Adventures of Tom Sawyer" where Indian Joe is accidentally locked in a cave and dies unable to open the door.
Mort in Ghost Story: "You probably shouldn't have left a freakin' ectomancer a pit full of wraiths to play with."
Parodied in the Saturday Night Live skits called MacGruber, in which he can get out of the room (which is always the exact same room, just with a different location sign over the door each time), but personal issues, interpersonal issues, stupidity, and totally irrelevant events prevent him from doing anything until it's too late.
I Spy had this as a frequent scenario (and predated MacGyver by two decades).
Doctor Who: "The Dalek Invasion of Earth". The Daleks lock the Doctor in a cell with a bar magnet. Dalek doors all use magnetic locks. Subverted because their goal was to find out if their prisoners were smart enough to escape.
Also in Doctor Who: "Attack of the Cybermen". The Doctor is locked in a storeroom containing explosives. Explosives just powerful enough to blow a large hole in a thick futuristic metal door without harming a person crouching at the other end of the small room.
"The Doctor's Wife": House possesses the TARDIS and leaves the Doctor behind on his planetoid former body, which happens to be TARDIS graveyard.
Knight Rider: "Goliath Returns". A group of Foundation employees are locked in a cell with exactly the parts they need to turn their collar tabs into a bomb.
The A-Team: Pretty much every episode involves the A-Team getting trapped somewhere like a barn where they could bust out via an armored car quickly thrown together using the materials at hand. This trope could just as easily have been called Locking The A Team In The Motor Pool Workshop.
One of the worst - in one episode they are on an Army base, and get locked in the armory.
Appeared in a Buffy the Vampire Slayer episode where Willow got locked in a storage room. Which contained a pencil. And her guards were vampires. You do the math. Her escape from there wasn't entirely successful, and to be fair to the vampires, they probably didn't expect that she could levitate the pencil with her mind.
Columbo, "No Time to Die" (1992) The bride of Columbo's nephew is kidnapped and trapped in a room. She uses vinegar left with her dinner to help remove the rust from the door hinges, while lubricating the pins. She scrapes away the rust with a fork and is able to push the pins out, freeing herself from the room. Sadly not from the rest of the house.
In the Star Trek: The Next Generation episode "Unification Part II", a group of Romulans lock Captain Picard, Lt. Commander Data, and Ambassador Spock, the supreme examples of the Smart Guy, in a room with a computer terminal and holographic projectors.
In the MythbustersMacGyver special, Adam and Jamie demonstrated that it was possible to escape a locked room by picking the door lock... with lightbulb filaments.
Subverted later that same episode, when as part of the MacGyver challenge, they were presented with a mock campsite which contained everything they needed to create a potato cannon (PVC tubes, gas under pressure, ignition source, potatoes) - something the show had in fact covered in a previous episode - and built a signal kite instead. Which may or may not count as a subversion, because the kite worked.
Subverted when they tried to stage a jailbreak using electricity, salsa, and dental floss to cut through the bars of a cell window. While Jamie did make some progress, he only did so by using a radio as an additional component, which he insisted the prison warden had given him for good behavior.
But the electricity from the radio only sped up the reaction; it did not cause it. Testing the myth the way it supposedly happened would've taken years. The radio was just there to show proof of concept.
A variation on this appeared in CSI NY; while investigating the death of a millionaire inside his mansion's panic room, one of the CSIs accidentally activates the protocol that seals him inside. While he doesn't use the items in there to escape (his friends call a locksmith to do that), he does use them to replace the forensics kit he left outside and complete the processing of the crime scene.
And in a variation on this theme, an Irish drug cartel once staged a crime scene to kidnap Danny and Adam, and held them prisoner while their teammates raided the central office (where they hoped to recover several tons of confiscated drugs.) Mistake #1: Danny had brought, and eventually regained access to, his forensics kit, which contained corrosive compounds. Mistake #2: the cartel leaders failed to lure Mac, Stella, and Hawkes from the CSI labs, where they had access to a whole plethora of tools and firearms with which to defend themselves and the evidence. (Mac was even able to rig up a claymore mine from ordinary lab materials.)
The episode, "Patterns of Force", features Spock and Kirk escaping from a prison after making a laser from a strip of metal, a light bulb, and the crystals from the radios implanted under their skins near the beginning of the episode.
In the episode, "Arena", powerful aliens place Kirk and the Gorn captain in a rocky area and are told specifically there are the components of weapons they can assemble if they are smart enough. As it is, Kirk is better at this since the best the Gorn could think of is a net and a sharpened piece of rock for a knife, Kirk Macgyvers a crude cannon from the materials around him.
The episode was inspired by a marginally harder-science story of the same name by Fredric Brown (who got an on-screen writing credit), in which the trick is to get through a force field that allows nothing conscious to pass. The alien builds a passable catapult while the human comes up with some flaming missiles, then knocks himself out to fall through the barrier (which up until this point he thought only allowed nonliving things to pass) and stabs the alien to death with a stone knife.
A very similar incident appeared in a second-season episode of Buck Rogers in the 25th Century wherein the doctor hypnotizes Wilma Deering to escape a force field with the same properties.
Hilariously parodied in the Red Dwarf episode "Rimmerworld", in which Lister comes up with a lengthy and elaborate plan to escape from a prison cell, and Kryten replies "Or we could use the teleporter."
"Quarantine" had the main characters in a, yes, quarantined room with dwindling oxygen. It just so happened that the group was locked in along with a Luck Virus. With an injection of artificial luck, Lister was able to open the door by randomly pressing buttons on the keypad-lock. Of course, it did take them five days to figure that out.
The entire first season of Prison Break is about how Michael Scofield breaks his brother out of prison using things from within the prison (well, and things he's prepared beforehand, with notes handily tattooed all over him in a form only he can decipher). Example: One of the first things he does is turn a screw from the prison bleachers into an allen wrench that can unscrew the cell sink. It's priceless MacGyvering.
In the original The Tomorrow People, one of the protagonists has begun to demonstrate a limited but effective form of telekinesis - he can open any lock. A gang of criminals kidnaps him and some of his family for leverage on the superhuman lockpick. At one point, the boss asks one of his mooks if the telekinetic and his family are safe. The mook's response - "Sure. Got 'em under lock and key."
Averted and lampshaded in Eleventh Hour: "Eternal". When Hood and Rachel are locked in a freezer by one of the villains. Hood pulls out a rack of shelves and boxes "for protection", Rachel asks if he's planning to fashion a bomb from things in the freezer. Hood's response? "I'm a scientist, I'm not MacGyver. Shoot the lock."
Stargate SG-1's episode "Prometheus" had a hijack attempt of the Earth's still-under-construction space battleship while Sam Carter was on it. At one point, evading pursuit, she ducks into a storage closet filled with supplies the construction crew was using to finish the ship, and closes the door. Because the external door controls haven't been installed yet, the hijackers decide that the best way to keep her out of trouble would be just to lock down the door entirely, trapping her in there. ...this turned out to be a pretty stupid idea.
Hodgins and Brennen on Bones may have outperformed even MacGyver in the first Gravedigger episode, when they were buried alive inside a car. They couldn't bust themselves out, but they did manage to prolong their own lives and communicate their location to rescuers using such items as a pocket knife, camera, car horn, depowered cell phone, lithium batteries, dirt, and an extremely expensive bottle of perfume.
In Breaking Bad, Walter White was tied to a heater within reach of a glass electric coffee jug. He accidentally flung the jug out of reach, but then escaped by ripping the wire out of the base, plugging in the other end and soldering his bonds.
In NCIS Ducky and Jimmy, the medical examiners, are kidnapped by a group of spies who need them to perform an autopsy on their deceased cohort who died before revealing where he hid the classified information he stole. The kidnappers cannot stand the smell of the autopsy so they leave the two doctors in the cabin while they stand guard outside. Ducky and Jimmy use the gastric acid from the dead man's stomach to cut through their leg chains and then make a bomb out of a cigarette, a surgical glove, a part of the dead man's lower intestine and some drain cleaner.
Metal Gear Solid likes to use this one. In the first game, for example, you're locked up in a jail cell with nothing but the clothes on your back and a useless bottle of ketchup. Naturally, you lie down on the floor and pour the ketchup all over yourself. When the guard comes in to check on the suddenly bloodied prisoner, you snap his neck and haul tail out of there.
In Metal Gear Solid 3 you can operate on your self using a fork to get to your fake death pill, handily hidden inside yourself. You can open the cell door with the correct radio frequency, or trick the guard into giving you a cig spray, or throw food to the guard so that he gets diarrhoea.
In GoldenEye 007, during the second Bunker level, James is locked in a cell next to Natalya. In order to escape, the player has to use their watch magnet to obtain the key from the guard. In addition to this, the player can also get a few throwing knives as well.
This happens in EVERY ADVENTURE GAME EVER, or at least all of those in which you're locked in a cell. Exception: occasionally you must manipulate the guard, rather than the items in the cell, to your advantage.
Averted in Quest For Glory 2, though. The hero is captured and thrown in jail after being stripped of all his equipment, but all three classes have a way out. The fighter can just break the door down (he's strong enough for that), the wizard can use the ubiquitous Open spell (they can't strip his magic), and the thief can pick the lock with the magical pin of Katta friendship, that those who are not Katta or friends of Katta cannot see. Ultimately turns into a subversion, when the villain actually wanted you to escape.
Monkey Island also likes to subvert it, by surrounding you with items, any one of which could get you out of your predicament, but they're all out of reach so you have to escape in a much more convoluted way.
The Legend of Zelda: Ocarina of Time: When captured upon entering the Gerudo Fortress, Link gets tossed into a cell. Subverted in that the cell is completely empty. Played straight in that the Gerudo don't think to take away any of the equipment Link already has, not even his sword.
Heck, in every single dungeon ever in the series, there's at least one room that locks behind you. If killing the enemies in the room doesn't trigger the mechanism to open the doors, there's always just the perfect number of crates/supplies of items in pots/ magically appearing chest with a new item to help you escape.
Tron 2.0: F-Con probably would have succeeded if they hadn't been fool enough to lock Alan Bradley in a closet full of computer parts.
Jolly Rover: James is locked in a ship's hold containing supplies anyone can use to escape, including a crate containing crowbars and skeleton keys, a cannon with gunpowder, and a box labeled "Escape Kit." Subverted in that he doesn't use any of those things because he either doesn't realize their potential or he can't open the crates.
In Fallout 3, after the Enclave captures you and takes you to Raven Rock, they stupidly put all your possessions in a locker in your cell.
In Rip And Teri, a spy has been captured by a rival and locked inside a broom closet. Unfortunately for the spy, the rival has removed everything that could possibly be of use to him to make his escape... but has neglected to put tape on the sharp edges of the doorframe, thus allowing the spy to cut through his bonds and escape. Naturally, the spy considers his rival a 'Rookie' for overlooking this minor detail.
In The Inexplicable Adventures of Bob!, Fructose Riboflavin escapes from his prison ship by deliberately tripping and falling at the feet of his robot guard, so the guard's heavy feet snap his chains. He then disables the robot and removes its Arm Cannon to blast open the other prisoners' cells and enslave them, and to take out the other robot guards. He uses the ship's parts to cobble together a cloaking device to install on a small escape pod and uses the pod to hitch a ride in another ship's "grav wake" to get to Earth undetected. Continuing in this fashion for a couple of days, he winds up in command of a stolen space warship armed with the most powerful weapon known to science and is makes ready to conquer a planet.
In the Haven Hive arc of Schlock Mercenary with Lt. Ventura — Major Murtaugh tried to be Genre Savvy and not have the "helpless-with-the-big-eyes" looking girl guarded by a human that might be swayed by it. She didn't even ask the prisoner's name and couldn't have known that allowing the genius roboticist with widely known and feared reputation among robots time alone with a robot and the AI controlling the spacecraft means the next phrase a human being will hear from her will be "get off my ship". The incredulous tone Ventura used at the suggestion of guarding her with a robot might have been a tip-off; her captor apparently misinterpreted it as the tone of voice one might use to say "You're posting five guards to my cell?" as opposed to disbelief of a child over being locked in a cell made of caramel.
In the Housepets! story arc "Show Business", King finds himself trapped in a tool shed when being chased by Duchess. This strip even mentions MacGyver by name. The ultimate solution to his dilemma is, however, somewhat more directly violent than most of MacGyver's solutions.
As you could expect from a Spark, Agatha from Girl Genius manages to pull this off. While she is not currently locked up, as one of the villains points out, she is many kilometers away from any potential allies, in unfamiliar territory in the middle of hash winter. There are also bad guys constantly looking for her with dogs specially trained to hunt down Sparks. Agatha still manages to build herself a fully functional escape device in form of… a swan-shaped sleigh and four flying robot pigs.
Tech Infantry has Xinjao O'Reilly and his engineering crew captured and locked in a storage room for tools and spare parts when their space station is seized by rebels. They waste no time in grabbing tools, using them to open access panels, and escape into the maintenance spaces inside the bulkheads. Lampshaded when Xinjao incredulously remarks on how stupid it is to lock up a bunch of starship engineers in the tool closet on their own space station.
ThisHitherby Dragons story has minions discussing where to lock MacGyver, before having to, reluctantly, lock him in a bare room.
The prison in "The Boiling Rock" was obviously intended for Firebending prisoners — it had several rows of refrigerated "coolers" — which was exactly what Sokka needed for his first escape attempt. In all fairness, they didn't realize they had Sokka there.
It looks like the extreme cold is meant to freeze the prisoners so they can't firebend. It didn't work on Zuko, who had lessons on firebending from dragons and his uncle.
Played with in the second season episode of The Tick animated series, "Leonardo da Vinci and His Fightin' Genius Time Commandos!" Leonardo Da Vinci and other famous inventors throughout history are kidnapped by a Mad Scientist and locked in a cage. Leonardo escapes largely by using the mattresses and flatware to make a flying machine. When the rest discuss inventing their own escape method, Ben Franklin says bitterly, "How? Da Vinci used all the best stuff!" George Washington Carver laments, "If I could just reach those peanuts...!". Then Wheel the caveman takes the sheets and invents a rope, which they use to climb out and turn the stuff outside the cell into an A-Team style war machine.
In Aladdin The Series, Abis Mal locks Aladdin in a dungeon with two skeletons. He uses a finger bone to pick the lock and escape.
The surreal reverse example in an episode of The Powerpuff Girls where three criminals get out of prison thanks to three conveniently placed Men sized Powerpuff Girl disguises within the jail cell. "This is going to be harder than I thought".
In The Venture Bros., The Monarch uses things that he finds in prison not only to break out but to rebuild an ersatz version of his costume, with orange jumpsuits hanging rather conspicuously off the wings.
As mentioned above, Batman. In the Justice League series, he was captured by a group of criminals in restrained, without his utility belt, in a full-body restraint made of inch-thick metal cables. He doesn't go anywhere at first, preferring instead to screw with the dysfunctional bad guy team from the inside. When that stops being fun, he promptly escapes to beat the Joker up. Then again, Batman is wearing his own store cupboard.
In the episode A Better World, when Batman is captured and put in a prison, his alternative universe counterpart, Lord-Batman, points out not to bother trying a certain technique since he build to prison specifically to counter anything Batman could think of (since being another version of Batman, he can think of everything Batman would). Flash then escapes by speeding up his heart rate so it appears like he has flatlined, causing Lord-Batman to open the prison to check on him.
In one episode of the old Birdman cartoon, a Gadgeteer Genius supervillain was allowed to spend his prison sentence working in the prison's metalshop. He built a suit of powered armor complete with a jetpack and escaped. The episode ends with the warden sensibly deciding that putting him in a metalshop isn't a good idea and switches him to laundry duty. In a later episode starring the same villain, he adds flight capability to a dryer and escapes in it. The warden finally figures out that putting the guy near any machinery is a bad idea and sends him to work in the prison's library.
Prisons are made very spartan in part to avert this trope. Many common items are specifically redesigned for prisons so that they cannot be used to create weapons or means of escape. For example, toothbrushes are made with very small handles and brush fibers that will not melt into a glue-like substance so that they cannot be made into shivs.
Of course, such specialized items were introduced by prison staff only after they experienced a bit too much Truth in Television. Even with all these precautions, prisoners continue to innovate new methods of creating weapons and other contraband (such as alcohol) from items provided to them. One prisoner featured on MSNBC's Lock-Up created a surprisingly effective shiv out of several pieces of hard candy.
Frank Morris and the Anglen brothers, Clarence and John, escaped from the "inescapable" Alcatraz off the coast of San Francisco by making a raft and life jackets out of raincoats, hiding the holes they dug from their cell with fake vents made of cardboard, and putting fake dummy heads in their beds, complete with real hair from the barber shop. Experts disagree on whether they could have made it to shore or not with the materials they had.
John Giles, the other escapee from Alcatraz. While working in Alcatraz's laundry room, he managed to assemble a complete army uniform by stealing one piece of clothing at a time. He simply put it on, stepped onto a departing military launch as if he had every right to be there, and would've been able to walk away a free man at its destination, had a random head-count not betrayed his absence.
The case of John Hunt Morgan, a Confederate General captured during the Civil War. Morgan and several of his officers escaped from an Ohio prison by digging through the floor of their cells to reach an airspace underneath the prison and then dug out to the courtyard. In order to finalize their escape, the prisoners utilized tied up bed sheets to climb the outer wall. As an added bonus, a mocking note was left for their guards which included a summary of how many hours of work the escape had required and thanked the guards for their hospitality.
Castle Colditz. A supposedly inescapable Nazi prison where the Reich bunched up its more troublesome prisoners, i.e. those who had already attempted to or escaped from other prison camps. The fact that the castle itself was a very, very poor prison in and of itself was compounded by the ingenuity of its inmates. One of the last attempts before the war ended involved a full-blown glider built in one of the attics. Although the prisoners didn't get a chance to use it, it probably would have worked. The launch mechanism was a bathtub full of concrete to be pushed out a window.
It isn't quite an escape attempt, but during World War 2 these guys built a working radio set from scratch inside of a Japanese POW camp.