A topological approach to the theory of equilibrium phase transitions in statistical physics is based on the topological hypothesis, which claims that phase transitions are due to changes of the topology of suitable submanifolds in the configuration space. In this paper we examine in detail the antiferromagnetic mean-field XY model and study the topology of the subenergy manifolds. The latter can be interpreted mechanically as the configuration space of a linkage with one telescopic leg. We use methods of Morse theory to describe explicitly the Betti numbers of this configuration space. We apply these results to the antiferromagnetic mean-field XY model and compute the exponential growth rate of the total Betti number. Previous authors studied the Euler characteristic rather than the total Betti number. We show that in the presence of an external magnetic field the model undergoes a single ‘total Betti number phase transition’.