Provided herein are synthetic methods for preparing a compound of formula (I): Also provided herein are synthetic methods for preparing a compound of formula (XIII): The disclosure also provides useful intermediates, derivatives, prodrugs, and pharmaceutically acceptable salts, solvates and hydrates of the formula (I) and formula (XIII) compounds. These compounds are useful for treating diseases associated with molybdenum cofactor deficiency.