The Z-vector method in the relativistic coupled-cluster framework is used to calculate magnetic hyperfine structure constant (AJ ) of alkali metals and singly charged alkaline earth metals in their ground state electronic configuration. The Z-vector results are in very good agreement with the experiment. The AJ values of Li, Na, K, Rb, Cs, Be + , Mg + , Ca + , and Sr + obtained in the Z-vector method are compared with the extended coupled-cluster results taken from Phys. Rev. A 91, 022512 (2015). The same basis and cutoff are used for the comparison purpose. The comparison shows that Z-vector method with the singles and double approximation can produce more precise wavefunction in the nuclear region than the ECC method.