Ali bin-Massoud has a head for gearwork, so he's in England apprenticing with the famous Charles Babbage. Then a clockwork falcon drops him an antique magical puzzle-box, which sends him running back home to deal with his father's death and -- eventually -- a bottled djinn, a cave of treasure with forty thieves in it, and a number of other familiar story elements.
The storytelling is pretty good. The steam/magical gimcrackery is also pretty good. This is an alternate world where England has automata in common use, Afsharid Persia has charms and coal-powered cameloids, and it all fits into the familiar story better than you might think. The problem I had was the antagonists. Ali's brother Kassim is a nasty greedy monster; he has little point in the story but to show off how pious and good-hearted Ali is by contrast. Then there's Rassul, the chief thief, who is nasty, greedy, sadistic, and prone to Darth-Vadering his own subordinates at the slightest disappointment. Kassim's wife Malakeh is the only one who shows any depth (she's greedy but not just an extension of her husband's existence).
Cartoon villains are okay for a fairy tale, but this book seems to be aiming at more complexity. It generally succeeds when portraying Ali, who is a good Muslim without being cartoonish about it. Ali has moments of weakness, but regrets them. He has moments of cultural blindness -- treating Malakeh peremptorily because she is a woman -- but this is appropriate for his character, and not treated shallowly either. (There is a plot point of whether he will marry his brother's wife after his brother comes to a well-deserved end. Culturally appropriate, as I said.)
And then there is the djinn, who is not very human -- good -- but not very interesting to me either.
So, overall, a nice fantasy portrayal of the Ali Baba story, but with gaps. And I don't think Babbage needed such a large part. He didn't add much.
(Modern steampunk mythology forces me to wonder where Ada Lovelace is hiding during all the Babbage scenes. I think this book is set well after her death.)