Compounds of formula I: (wherein variables A1, A2, A3, A4, A5, A6, A7, B1, B2, B3, B4, D1, D2, E1, E2, E3, E4, E5, G1, G2, J, K, T, U, V, W, X, Y and Z are as described herein) which are antagonists of CGRP receptors and which are useful in the treatment or prevention of diseases in which the CGRP is involved, such as migraine. The invention is also directed to pharmaceutical compositions comprising these compounds and the use of these compounds and compositions in the prevention or treatment of such diseases in which CGRP is involved.