Conversion of an amide to a high-energy thioester by Staphylococcus aureus sortase A is powered by variable binding affinity for calcium.