AT FIRST, President Carter was tempted to try old fashioned gunboat diplomacy by sending an aircraft carrier into the Persian Gulf. He ended up, instead, sending his defense secretary on a Mideast swing.

Carter's choice provides another piece of tangible evidence that American leaders -- whether Democratic or Republican, hawk or dove -- are facing a new reality: U.S. military power, no matter how well financed, has limited application in contested areas of the world.

This reality is hard for many people, both inside and outside of government, to swallow. But Vietnam taught that lesson and Iran has reinforced it. We lost more than 50,000 American lives in Vietnam and sold the shah the best weapons money could buy, obviously to no avail so far as the final outcomes are concerned.

But while many policymakers bewail the supposed "weakness" of our position, there are important levers within the U.S. military establishment which have only been lightly touched.

I am referring to what the Army used to call "domestic action." That means using the military's skill, equipment and labor to do good works, building roads on Indian reservations or clinics in small communities which cannot afford them. Some years ago, I went with GIs to a small Colorado town and watched them build a new jail and fix the water system. I've never sensed so much enthusiasm in the ranks, before or since.

Domestic undertakings by the military have long met political and economic resistance. Troops paving a road or building a clinic connote "military takeover" to many Americans. Politicians get nervous. Contractors and unions complain that the military is taking away business.

But many other nations vital to U.S. interests do not put up such resistance. Saudi Arabia, Nigeria, China -- to name just three coutries where the United States is seeking close ties -- have all embraced the U.S. Army Corps of Engineers.

The Corps is general contractor for the modernization of Saudi Arabia -- everything from mosques to shopping centers to the country's West Point. The Corps is negotiating with Nigeria to help tame the Niger River and is discussing a wide range of water development projects with China. Bulldozers, not tanks, promise to pave the way to influence. Beginnings of Wisdom?

AS IMPRESSIVE as the Corps has become in nation-building, much more could be done if national leaders turned their attention to the task. The Navy's Seabees could be used profitably in this way, as could the Air Force and Marines.

If the United States needs to train troops in building roads and bridges anyway, who not do it in Third World countries that need the assitance? While there no doubt would be problems, the potential payoff is great.

It's more exciting, of course, to talk about sending in the Marines or sailing an aircraft carrier into the Persian Gulf or uncovering the missile silos in the Northwest to show Russia we mean business. But what good would those heavy gestures have done in Angola, Zaire or Iran? When the Zaire conflict heated up last year, I called up Gen. William C. Westmoreland, former field commander in Vietnam, and asked what the U.S. military could do there if it had been asked.

"I know how to get the troops in there," Westmoreland replied, "but I don't know how to get them out." Air Force Gen. David C. Jones, chairman of the Joint Chiefs of Staff, terms that a "good statement."

"Heightened nationalism, resource competition and interdependence," Jones noted in his posture statement this year, have "diffused political and economic decision making and reduced the power of any single nation to determine the course of other nation's policies." Even so, the nation's top-ranking military officer said, "The United States remains the premier world power."

Marine Commandant Louis H. Wilson, a soldier's soldier who won the Congressional Medal of Honor for heroism in World War II, also has come to terms with the limits of U.S. military power."We have to accept the world as we find it," Gen. Wilson says. "We simply have no ability, nor indeed do I think we should have, to go around putting down problems with countries throughout the world. The Third World is going to be in continual turmoil as they try to better their lives and want to do it faster."

Maybe this is the beginning of wisdom, not weakness.