We present an efficient and numerically stable algorithm for calculation of two-particle response functions within the dynamical mean-field theory. The technique is based on inferring the high frequency asymptotic behavior of the irreducible vertex function from the local dynamical susceptibility. The algorithm is tested on several examples. In all cases rapid convergence of the vertex function towards its asymptotic form is observed.