To hear President Trump and allies tell it, the threat of tariffs won a deeper commitment from Mexico to stem the flow of migrants. One Republican senator described the president as “brilliantly” using leverage. Others, through reporting by the New York Times and Bloomberg, have explained that Mexico pledged months ago to take the steps touted by the White House in an announcement Friday evening about a deal removing the tariff threat.

One factor in obvious play is the president’s lack of credibility, after the many half-truths, misrepresentations and lies. He makes it hard to believe almost anything he says.

In this instance, Mexico faced a clear disadvantage. The American economy is the market for 80 percent of Mexican goods. Tariffs starting at 5 percent, and climbing to 25 percent by October, as the president proposed, would risk immense harm to the Mexican economy. The president shed light on this reality and his thinking when he told CNBC on Monday, “Tariffs are a beautiful thing when you are the piggy bank.”

U.S. Sen. Sherrod Brown calls tariffs “a temporary tool we use against trade cheats.” As it is, the president wasn’t tangling with Mexico on a matter of trade. He wants the Mexican government to do more to prevent migrants, often exiting El Salvador, Guatemala and Honduras, from crossing Mexico to seek entry into the United States. Now Mexico will send additional national guard troops to its southern border and expand the program that allows asylum-seekers to remain in Mexico while their cases proceed here.

And if the White House later deems Mexico has failed to keep its word? The president says he will return to threatening tariffs. Which gets to what is so misguided in his approach.

After all, his threats belong in context, starting with the United States-Mexico-Canada Agreement, the update of the North American Free Trade Agreement. The new trade accord amounts to an upgrade. It also holds to familiar principles, most notably the removal of trade barriers such as tariffs. The three countries are moving toward each giving its official approval. The hope is they will act soon.

Yet what is Mexico, or Canada, to think? The president appears willing to violate the spirit of the agreement by using tariffs to get his way on unrelated issues. No wonder the U.S. Chamber of Commerce and even usually docile Senate Republicans objected to the tactic. They recognize the potential harm to the American economy. For instance, Mexico is Ohio’s second largest export market, the volume growing from $751 million in 1993, a year before the free-trade deal, to $6.5 billion in 2017 — a 766 percent increase, or a positive trend for a state long struggling with an economic transition.

All of that supports jobs for Ohioans. It also points to how increasingly integrated the Mexican and American economies have become. The auto industry serves as the prime example. The two countries make cars together.

Still, larger things are at stake, beyond trust among trading partners and neighbors to the state of American leadership and influence. What good is a trade agreement if the most powerful party is willing to abandon core provisions? Why negotiate a deal? With regard to Mexico especially, the president’s behavior runs counter to the improved relations of the past 25 years.

What’s more, neither tariffs nor the Mexican military will solve the migrant problem. That requires attention to the violence, poverty and corruption in the countries migrants are fleeing. It involves more resources at the border to accelerate the processing of asylum claims. In these ways, Mexico already has been doing more than the president likes to say.