This paper studies the distributed optimal output agreement problem for multi-agent systems with the agents admitting the essential reference-tracking capability characterized by the well-known notion of system types. In the present system setup, the agents know only the gradient values of their corresponding local objective functions, and distributed optimizers are designed to generate reference signals for the agents. Under mild assumptions on the local objective functions and the connectivity between the agents, it is shown that the agents’ outputs can be steered to the global optimum of the total objective function as long as the system type of each agent is not less than one. A numerical example on the simultaneous formation and source seeking of a group of vertical take-off and landing (VTOL) vehicles is employed to verify the effectiveness of the proposed approach.