The summit week of the UN general assembly was always bound to be fraught with risk for US prestige: it would involve Donald Trump interacting in a multilateral arena – and Trump famously does not play nicely with other leaders.

At the Nato summit in May he manhandled Duško Marković, the prime minister of Montenegro, to get to the centre of a group photograph, where he stood preening among his bemused peers.

This week, the US delegation avoided such visual comedy, though there was at least one Mr Bean moment, at a lunch for African leaders in which Trump extolled the health service of the non-existent nation of “Nambia”. He told his audience – heads of countries with long, painful colonial histories – that he had “so many friends going to your countries, trying to get rich”.

But such group outings were kept to a minimum. A side meeting on UN reform was kept brief in the extreme: 13 minutes – of which Trump spoke for nine. He began by slipping in a plug for the golden Trump World Tower across the road; his first remarks as president on UN ground were spoken as a property developer.

For most of his stay he was sequestered in a Midtown hotel (not his own) and received a succession of visits from heads of state and government.

As with most presidents at general assemblies, Trump’s role was defined by his formal address to the chamber on the opening day, Tuesday. He certainly put his stamp on it. His speech will be remembered principally for its name-calling (he dubbed Kim Jong-un “Rocket Man”) – and his threat to “totally destroy” North Korea.

On one level, this was just a restatement of US deterrence, based on the inevitability of an overwhelming response to an attack. But the threat to obliterate a whole country, a whole population, jarred awkwardly in a chamber intended to be the world’s temple to peace and diplomacy. Brandishing of earth-ending nuclear weapons is not encouraged. Diplomats in the chamber said the collective gasp was audible.

Alongside the threats of annihilation, the 41-minute speech was a mishmash of themes pointing in different directions. By picking out a trio of arch-enemies – North Korea, Iran and Venezuela – Trump channelled the neo-conservative impulses of the Bush administration and the axis of evil.

The threat to obliterate a whole country jarred awkwardly in the world’s temple to peace and diplomacy

Other passages hammered away at the primacy of national sovereignty in international relations. It is an axiom for foreign policy “realists” and America Firsters, but in recent years, it has also been the mantra of Russia, China and members of the Non-Aligned Movement, who bristle at the idea of foreigners passing judgment on their human rights records.

In between, there were sections of traditional boilerplate western diplomatic talk. The tonal incoherence made the speech sound very much like a text pieced together by committee – one made up of people who have failed to resolve their differences.

There was no clear explanation of why the supremacy of national sovereignty did not apply to Trump’s enemies. Nor was it made clear why Venezuela, a country far too impoverished for advanced weapons or exporting revolutions, was doing on the list alongside North Korea and Iran.

Until recently, European diplomats would point to the more conventional officials around Trump as proof that there was continuity and stability underpinning US foreign policy. That argument disappeared at this general assembly, to be replaced by more open expressions of alarm of the global dangers posed by his turbulent personality.

Trump arrives at the UN with first lady Melania. Nikki Haley, the US ambassador, is on the left. Photograph: John Moore/Getty Images

It was one thing for Trump to make no mention of climate change in his address to the world’s leaders. It was more problematic that US officials felt they could not even take part in multilateral discussions on the issue. When the UN secretary general, António Guterres, and the French president, Emmanuel Macron, held an informal off-the-record session on the struggle with global warming, no US representatives turned up.

There was anxiety, too, about the implications of turning the North Korean standoff into a personal grudge match between Trump and Kim Jong-un, who took to exchanging playground taunts. Kim responded to Trump’s speech by calling him a “mentally deranged US dotard”. Hours later, on Friday morning, Trump fired back with a tweet saying Kim was “obviously a madman who doesn’t mind starving or killing his people” who would be “tested like never before!”

Both men, several diplomats at the UN pointed out, were making it harder for the other to stand down and compromise.

Trump may have exacerbated the North Korean crisis, but he did not create it. The same is not necessarily true for the Iranian nuclear issue.

Trump’s apparent determination to take the US out of the 2015 nuclear deal – even while his administration concedes that Iran has kept to the terms of the agreement – has driven a deep wedge between the White House and European allies.

Ministers at a Wednesday night meeting on implementation of the deal were incredulous at Rex Tillerson’s justifications for his boss’s position. One was based on a sentence from the preface of the agreement of the text, which expressed anticipation that the deal would contribute to regional peace and security.

Iran was still a “malign actor” in Syria, Iraq, Yemen and Lebanon, Tillerson argued, so it was therefore not meeting the “expectations” implied in that sentence.

The other foreign ministers around the table pointed out regional conflicts were explicitly excluded from consideration under the 2015 deal, which was intended to prevent those conflicts turning nuclear.

Tillerson’s other objection was that some of the restraints on Iran’s nuclear programme imposed by the deal would expire in 2025. Surely that was a reason to start negotiations on a follow-on agreement, the Europeans argued, not blow up the existing deal immediately.

When Federica Mogherini, the EU policy chief, emerged from the meeting room on Wednesday evening, she was clearly boiling over with frustration, warning that the US would be in violation of a security council resolution if it ditched the deal.

Macron later said he simply failed to understand the US position. Why abandon an international agreement when you have no alternative to offer, he asked.

British diplomats insist that, no matter how desperately the UK might need a trade deal after Brexit, the country will not abandon its commitment to the Iran deal to please Trump.

Theresa May herself was publicly humiliated by Tillerson, who told the press she had asked Trump about his final decision on the agreement and he had refused to tell her.

Towards the end of the week, one senior diplomat said she could not remember a more emotionally exhausting general assembly.

It has always had its elements of theatre and a tradition of blowhards and clowns, like Muammar Gadafy and Hugo Chávez, playing to the gallery.

But this time the jester has taken centre stage and is dictating events.