"I think we just made a mess of it," the British foreign secretary, Lord Carrington, said the other day about cooperation between the United States and its allies in responding to the Soviet invasion of Afghanistan. Given that frank spirit, it is possible, after talks with leading officials, to see how the alliance lost its way.

Basically, the West German, French and British governments did their own thing -- reacting to the trouble in ways consistent with their national and political interests. They did not pull together with the United States, and are still not pulling together, because Washington never defined a track that drew them toward joint effort of a serious kind.

West Germany counts as its special interest the maintenance of its eastern policy, or Ostpolitik. Sixteen million other Germans live under communist domination in the state to the east. Berlin is always up for grabs. Important business is to be done with the other countries of Eastern Europe, and with the Soviet Union. So Bonn has a vital national interest in maintaining ties with Moscow.

Chancellor Helmut Schmidt has a special political stake in the Soviet connection. The Ostpolitik separates his coalition government from the uncompromising anti-communists in the Christian-Democratic opposition. It enables him to hold by his side the left wing of his own Social Democratic Party. With national elections coming on Oct. 5, both objectives are crucial.

So when the Afghanistan invasion occurred, Schmidt's first concern was to save his Ostpolitik from overreaction by Washington. He visited the White House early last month ready to pay a high price. He was prepared to give the United States major support in Turkey or Pakistan, or even to put pressure on radical states such as Libya and South Yemem. When all he was asked to do was boycott the Olympics, he acceded with alacrity. Since then he has been busy cultivating economic ties with Moscow and protecting political ties with East Germany. All the while he has been saying -- for him -- very nice things about President Carter.

President Valery Giscard d'Estaing of France has the formidable problem of following in the footsteps of Gen. Charles de Gaulle. He has to make his country count for something in the affairs of the world and in a way that is different from the United States'. That national expectation is reinforced by his political interest to neutralize lare blocs of Gaullist and communist voters in the presidential elections next year.

The bent of France, in these conditions, is to go into business on its own.

The French president has done exactly that.

He cultivated Iran by protecting Ayatollah Khomeini during his period in exile. He endeared himself to Saudi Arabia by sending troops to help put down the troubles in Mecca. He furnished Iraq with weapons-grade material for a nuclear reactor and with jet war planes. Most recently he has embraced the cause of the Palestine Liberation Organization.

When asked about common objectives, the French claim that the connections they make in Iran, Iraq, Saudi Arabia and with the PLO will help the United States once Washington starts to become serious about achieving security in the Persian Gulf area. Such security, the French argue, can be obtained by following another French lead -- a deal with Moscow whereby the Russians pull out of Afghanistan and give that country some kind of neutral status.

Britain's interest is to be middle man between the United States, on the one hand, and France and Germany, on the other. In that way, London will maximize its special relation with Washington and its standing with the European Economic Community, where it has big fish to fry. In the same way, and not so coincidentially, Prime Minister Margaret Thatcher can show that she is a true Tory, able to stand by the American connection and get the most out of the Europeans.

So Thatcher tooted the American horn by giving rhetorical support to a tough stance on Iran and Afghanistan. Lord Carrington sounded the European note by pushing the French idea of neutralizing Afghanistan. Together they are using North Sea oil to pry out of the French and Germans a much better deal on the financial terms of British membership in the Common Market.

The upshot is what Lord Carrington called a "mess" and what many Americans feel to be a lack of strong support from its allies in this country and the continent. Carrington believes that "nobody in particular was to blame."

But the positions of the Germans, the French and the British represents the normal ingredient of alliance politics -- not something new. What is new -- what remains new -- is the inability of Washington to define a steady position that engages heavy British and German cooperation as a matter of self-interest, and French acquiescence on pain of isolation. For as a British friend said to me the other day, "When the Americans don't know where they're going, we all get lost."