The search of a clustering signal in the arrival directions of ultra-high-energy cosmic rays (UHECRs) is a standard method to assess the level of anisotropy of the data sets under investigation. Here, we first show how to quantify the sensitivity of a UHECR detector to the detection of anisotropy, and then propose a new method that advances the study of the two-point auto-correlation function, enabling one to put astrophysically meaningful constraints on both the effective UHECR source density and the angular deflections that these charged particles suffer while they propagate through the galactic and intergalactic magnetic fields. We apply the method to simulated data sets obtained under various astrophysical conditions, and show how the i...