The White House did not elaborate. But one possibility is that Mr. Trump was thinking of a proposal to allow state governments to force internet retailers to collect sales taxes from their customers. The bill — called the Marketplace Fairness Act — has been pushed for years by brick-and-mortar retailers like Walmart, which have been losing ground as e-commerce has grown.

The bill passed the Senate in 2013, 69 to 27, with bipartisan support. It was reintroduced by a similar coalition in April but faces opposition from House Republicans.

If Mr. Trump was implying that Amazon had failed to add taxes where they were due, he was mistaken. The company long balked at collecting sales taxes, but by 2012 it was collecting taxes in California, Texas, Pennsylvania and other states. It even joined its former opponents that year in lobbying Congress to pass federal legislation that would compel its online competitors to follow suit.

The idea not only is anathema to anti-tax advocates but also would seem to be at odds with Mr. Trump’s own promise that “we are going to be cutting taxes massively both for the middle class and for companies.”

White House aides and Republican lawmakers have frequently despaired over the president’s fondness for firing off policy statements on Twitter and other social media platforms.