MEXICAN President Miguel de la Madrid's visit to Washington this week will severely test President Reagan's mettle as ''chief diplomat,'' an American chief executive's most important informal role.
The United States captained the rescue boat that prevented Mexico's inflation-ravaged, debt-ridden economy from going belly up in August 1982. Despite this assistance, Mexican leaders have sharply criticized Reagan's Caribbean demarches.
''My government deplores the events that have occurred . . . and condemns the violation of the principles of nonintervention, self-determination of peoples, territorial integrity of states, and proscription against the use of force,'' Foreign Minister Bernardo Sepulveda told the Organization of American States in the wake of last November's Grenada intervention.
Five months later, Mr. Sepulveda denounced CIA-directed mining of Nicaraguan ports while sympathizing with efforts to eliminate ''warlike action against Nicaragua.'' Mexico complements such expressions with diplomatic support for the Sandinistas within the Contadora group, scientific and technical aid, forbearance on Managua's $300 million debt, and the provision of more than 7,500 barrels per day of oil gratis.
Mexico's actions have caused presidential assistants to urge that Mr. Reagan make future US financial help contingent upon Mr. de la Madrid's embrace of Washington's policies in the region.
While viscerally appealing, such a quid pro quo is about as realistic as constructing a Mayan temple in Foggy Bottom. A confluence of factors - including national pride and resistance to Uncle Sam's tutelage - would lead Reagan's guest to scorn any such deal.
Mr. Reagan should not squander time, energy, and any personal goodwill generated in two previous meetings with de la Madrid by playing the Dutch uncle about Central America. Instead, he must comprehend the salience of economics over politics in US-Mexican affairs and explore steps to stimulate trade and investment in order to advance the national interest - and security - of neighbors living cheek by jowl along a 2,000-mile undefended border.
Specifically, he should:
* Recognize Mexico's significance as the United States' third-largest trading partner and pump for a commercial treaty to include, at a bare minimum, an ''injury test'' for Mexican exports - these range from petrochemicals to manhole covers to toy balloons - that now face protracted litigation and countervailing duties (restrictionists must remember that Mexico spends the dollars it earns to acquire American goods and services).
* Encourage the purchase of American manufactured goods through mechanisms such as the $500 million credit recently extended to Mexico by the US Export-Import Bank.
* Consider expanding the export of dairy products and other farm items as a follow-up to the $790 million grain sale announced last month.
* Reaffirm US readiness to import additional volumes of petroleum from Mexico - now this country's principal supplier - even on prepaid terms, for the Strategic Petroleum Reserve.
* Stress the value to both nations of an improved investment climate in Mexico, where a dearth of private investment, both domestic and foreign, inhibits economic recovery and job creation.
* Offer technical assistance in tourism, road construction, and other labor-intensive activities to expand opportunities in an economy where one-half the work force is unemployed or underemployed.
* Applaud Mexico both for its pooh-poohing of the idea of a ''debtor's cartel'' in Latin America and for its recent leadership in keeping Argentina's loans to US banks from being declared ''nonperforming.''
* Understand the enormous burden of high US interest rates on Mexico, which has an $85 billion foreign debt.
Mexicans sometimes exhibit either a Cuauhtemoc or Quetzalcoatl attitude. The former connotes a dread of contact with foreigners, just as Aztec chieftain Cuauhtemoc feared Cortes, his 16th-century Spanish conqueror; the latter describes a type of thinking like that of the Aztecs, who believed that the great white god Quetzalcoatl would bring salvation from across the sea.
Particularly notable with respect to the United States, this love-hate attitude complicates bilateral relations and obviates simplistic solutions to knotty problems. Only by spurning confrontation over Central America in favor of cooperation in economic matters can Mr. Reagan expect to appear as an adroit manager of foreign policy, rather than as a spokesman for hawks and ideologues within his administration.