Abstract This paper investigates the flocking problem for leader–follower multi-agent systems in directed graphs with switching topology. A decentralized state control rule, namely, a second-order protocol, is designed for each agent to track the leader. And it is proved that the proposed control scheme can effectively estimate the tracking error of each agent when the leader is active. Particularly, to ensure the tracking error can be estimated, the following two questions are solved: (1) How many agents are needed to connect to the leader? (2) How should these connections be distributed? Finally, a simple example is also given to verify the effectiveness of the proposed theorems.