Foreign ministers from 22 countries, some of the richest and poorest nations, arrived in this tranquil beach resort today to piece together an agenda for a more tranquil world.

The basic purpose this two-day meeting, starting Saturday, is to pave the way for a session of their national leaders here Oct. 22-23 that is intended to find ways to address divisions between wealthy nations of the North and impoverished developing nations of the South.

All this had been tried before, although never at such high levels.

As Mexican Foreign Minister Jorge Castaneda said at a press conference Tuesday, in the past the "confrontation between the two positions" created only "lists of aspirations in some cases, and lists of recriminations." He added: "Now the situation is more grave."

The 1979 report of the independant Commission on International Development, chaired by the former chacellor of West Germany, Willy Brandt, put the situation more bluntly. "The search for solutions is not an act of benevolence but a condition of mutual survival," it concluded.

The central issue is how the world's resources are to be distributed. As the Brandt Commission -- whose report led to calling the summitt -- pointed out, the inequities between the rich nations and the poor nations have grown explosive.

But no one here is pretending that the October summit will resolve that basic problem. What is hoped for is the beginning of a serious dialogue about it.

"What we want," said an Indian dipolmat who arrived here last night, "is an end to the stagnation."

While the task of the officials, inlcuding Secretary of State Alexander M. Haig Jr., is primarily to work out a framework for the October summit, even that may be difficult.

A senior Algerian diplomat said recently that if the agenda formulated here does not seem oriented toward an expansion of the dialogue, especially in the United Nations, his country may decide not to return in October.

The United States has maintained thus far that this meeting and even the October summit should be without any formal agenda.One U.S. official emphasized Washington's position that it has come to Cancun for dialogue; nothing less, but perhaps nothing more.

The final list of participants brings together the United States, West Germanay, Austria, Canada, France, Japan, Britian and Sweden representing the north. Yugoslavia and China are represented, as are Saudi yarabia, Algeria, Brazil, Bangladesh, the Ivory Coast, the Phillipines, Guyana, India, Nigeria, Tanzania, Venezuela and Mexico.