Code Lightfall and the Robot King by Daniel H. Wilson
When Code Lightfall tumbles down a hole in pursuit of a mysterious robotic insect, he lands in a world that defies imagination. Everything in Mekhos is made from metal and circuitry, including the inhabitants. To find his way home Code must cross Mekhos's bizarre and dangerous landscape to reach the legendary Robonomicon - a guide to all robot wisdom. But the robots of Mekhos are also in peril, and Code must rescue them before he can save himself. With its dazzling array of robots and futuristic gadgets, this rollicking story will hold special appeal for budding techno-lovers everywhere.