In one of his recent tweetstorms, President Trump complained about fake news, as he called it, denouncing reports that raised a suggestion that John Kelly, the chief of staff at the White House, could leave soon. Kelly's been on the job for just a few months. He's a former Marine general, a gold star father and a former Trump cabinet secretary who's now trying to impose order on the White House. He's had some success. But as NPR's Mara Liasson reports, there are limits.

MARA LIASSON, BYLINE: This week would be a test for any chief of staff. Among other things on John Kelly's to-do list - keep the famously undisciplined president on script in his tax reform speech in Pennsylvania last night, which he did.

(SOUNDBITE OF ARCHIVED RECORDING)

PRESIDENT DONALD TRUMP: And we will make taxes simple, and easy and fair for all America.

(APPLAUSE)

LIASSON: And over the next few days, Kelly has to pull off a delicate balancing act that allows the president to fulfill his campaign pledge to decertify the Iran nuclear deal without scuttling the agreement altogether. President Trump says he's happy with Kelly and expects him to stay on for the entire remaining seven years.

(SOUNDBITE OF ARCHIVED RECORDING)

TRUMP: So General Kelly's a four-star. Not a bad general, right? You don't get any better than General Kelly.

LIASSON: Press secretary Sarah Sanders says that's because Kelly has a clear vision of what his job is and isn't.

SARAH HUCKABEE SANDERS: You know, you hear these things - that he's trying to manage the president. That's the opposite of what he's trying to do. He's trying to manage the staff so that they can actually fully support the president in the best way possible.

LIASSON: Kelly has been in public service all his life. At a speech at George Washington University in April, before he was named chief of staff, Kelly described all the times he's had to raise his right hand to take an oath of office.

(SOUNDBITE OF ARCHIVED RECORDING)

JOHN KELLY: Our nation is unique in that we swear our allegiance to a piece of paper, a Constitution, to law - not to a king, not to a president, not to a party, but the supreme law of the land.

LIASSON: That hasn't changed since Kelly came to the White House. He continues to see his job as working for America, the Constitution and then Donald Trump, in that order. Kelly has cleaned house at the White House. Since he arrived, several of the most controversial Trump aides have left. And White House budget director Mick Mulvaney told NBC that Kelly has also made big changes in the way information and advice get to the president.

(SOUNDBITE OF TV SHOW, "MEET THE PRESS")

MICK MULVANEY: Folks would just come in, and there was an open-door policy, and they can wander in and talk to the president about anything. That's probably not the most effective way to get information about very, very complex issues in front of the president of the United States. So what would John has done is really refined that flow of information so that we know before it - the president sees it, it's right, it's accurate and it's ready for him to act on.

LIASSON: But Kelly hasn't changed the president's impulsive, instinctive approach to his job, nor has he tried to. Barry Bennett, a senior adviser to Trump during the campaign, says the president doesn't like being managed or even scheduled.

BARRY BENNETT: I remember in the campaign, people would say, hey, we're going to have a call next Tuesday. And he'd be like, why can't we do it now? So I don't think you can muzzle him. I think what you can do is give him really good information that has really good suggestions. The president has an amazing political ear, and he's going to exercise that. He's going to be on Twitter whether any of like it or not.

LIASSON: Kelly has been reported to be frustrated with Trump's behavior. But White House officials deny that pictures of Kelly with his head in his hand should be interpreted as signs of dissatisfaction. Before Kelly was chief of staff or homeland security secretary, he was the military aide to President Obama's secretary of defense, Leon Panetta, and the two have talked since Kelly became White House chief of staff. Panetta says his main question about Kelly's tenure is really about Donald Trump.

LEON PANETTA: He obviously is still tweeting. And he still seems to operate by instinct often, as opposed to a clear policy process. And so the real question in the end is going to be whether or not he's willing to accept the overall discipline that John Kelly wants to put in place.

LIASSON: And that, says Panetta, who has also served as a White House chief of staff, puts unusual pressure on Kelly.

PANETTA: ...Because most chiefs of staff usually are working with a president who has some experience, who kind of is thoughtful about the issues that are confronting this country and the world. This chief of staff not only has to have a strong discipline within the White House, he's got to be able to make sure that, ultimately, a president who is very difficult to control is saying and doing what is responsible as president of the United States.

LIASSON: Panetta says that is a burden no other White House chief of staff has ever had to assume. Mara Liasson, NPR News, Washington. Transcript provided by NPR, Copyright NPR.