A metal-organic framework as a chemical guide to control hydrogen desorption pathways of ammonia borane.