The First Cowboy rounded up Congress last night, and instead of shooting it out in the White House Corral, he lassoed them with praise.

"Although the executive branch may compete with the legislative branch and vice versa, the U.S. Congress remains the greatest invention in self government this world has ever seen, and all of you in the House and Senate do it proud," President Reagan told some 900 members of Congress and their guests at his annual barbecue on the South Lawn.

Lawmakers ate it up, along with chili tejas, chicken fajita, frijoles ranchero and other Mexican fare. Sipping beer and California wine as they sat under a crescent moon, they took the night off from partisan politics and legislative warfare. Democrats and Republicans alike trailed along after Reagan as he made his way through the crowd.

"I didn't tell him anything. We didn't talk business," said Senate Majority Leader Robert Dole, who joined in the procession and who shared a table with Reagan. Dole has indicated there is little likelihood that the Senate will take action on a tax reform bill in 1985.

Favoring Hollywood casual rather than cowboy chic, Reagan wore a light plaid jacket, with navy sports shirt and navy trousers. He came bareheaded but symbolically, perhaps, when he left the party an hour later he was wearing a white Stetson adorned with the head of a snake baring its fangs.

"I can't wait to get to a mirror," the president said of the hat given him by country singer Mickey Gilley, who came up from Texas to entertain.

In thanking Gilley, who runs what he claims is the world's largest nightclub in Pasadena, Tex., Reagan made reference to a "music hall" here in Washington.

"It's up there on a hill, called the Capitol. We've got lots of vocal talent, but they're not always so good when it comes to carrying a tune."

(A scattering of boos here.)

"That's why I always enjoy these get-togethers," the president continued. "Most of the time we have our differences but at times like these we stop being Republicans and Democrats and just eat."

Kidding aside, Reagan's usual quick wit landed wide of the mark as he trotted out a couple of old gray mares in the joke department.

Joke No. 1: "I understand a tough young cowboy came in one night and said, 'I want a real rare steak.' About three minutes later the waiter came back with the steak and the kid took a look at it and said, 'Take it back.' The waiter said, 'You said you wanted a real rare steak,' and the kid said, 'I've seen cows hurt worse than that get up and walk away.' "

(Groans here mixed with tepid laughter.)

Joke No. 2: "I only did that as an excuse to tell a little something I saw in The Milwaukee Journal, which if you stretch it, might apply to the activities of all of us -- our friends out here and myself, the things we go through. This is about a woman reading about all the crime and violence and how she became frightened enough so she started studying judo and she was a master of the art and went all the way to the top. Then one night the thing she dreaded happened. She was walking down the street about 9:30 and a fellow stepped out of a doorway and grabbed her. And she hit him over the head with her umbrella."

(Tepid laughter here mixed with groans.)

Among the guests were Vice President George Bush and his wife Barbara. Besides Dole, seated at Reagan's table were First Lady Nancy Reagan, Transportation Secretary Elizabeth Dole, House Minority Leader Robert Michel and his wife Corinne.

Most of the Cabinet was at the party, some of them, like Secretary of State George Shultz and Agriculture Secretary John Block, for the evening. Others, like Treasury Secretary James Baker, were just passing through.

Baker was a logical target for questions about tax reform. When a reporter told him that there is a suspicion going around that the president is not so dead set this year on it, Baker appeared surprised. "Hey, B, come here and help me," the secretary called out to M. B. Oglesby Jr., presidential assistant for legislative affairs. "The White House press is saying that somehow the president's not committed to tax reform and he's accepting the fact that it's going to be next year. I said, 'Boy, if you'd been in the meeting today with the president and Sen. Bob Packwood . . . "

"That's right," said Oglesby, riding to the rescue, "far be it from us to leak what happens in a presidential meeting, but Senator Packwood said today that we'll get a bill this year if we stay till Christmas."

Nearby, the subject was Soviet leader Mikhail Gorbachev.

"Based on raw material, he's not 10 feet tall. He's actually 5 feet 6 and three-quarter inches," said Sen. John Warner (R-Va.), who probably didn't measure Gorbachev but with seven Senate colleagues had 3 1/2 hours to size him up in Moscow recently.

"I think he's the smartest leader they've had since World War II, but Reagan will be able to handle him," said Sen. Strom Thurmond (R-S.C.), who also made the trip.

Thurmond said Gorbachev emphasized that he's chairman of the Soviets' defense commission and "that's the most important thing. He wanted us to know he's the boss . . . I told him, 'You ought to get out of Afghanistan, you ought to get out of Angola, you ought to get out of Ethiopia and you ought to get out of Central America.' He said he agreed with most of what I said."

The Mexican food, served cafeteria style, took a Dallas firm, El Chico Corp., two days to prepare. Its owners brought along yet another hat for Reagan, this one a blue sombrero that they finally located in Mexico City after a long search. "They don't make them anymore," said Sylvia Cuellar.

Party favors were red coasters with a White House logo. When a White House aide, wearing a button inscribed "I'm Presidential Material," handed a coaster to Rep. Jack Kemp (R-N.Y.), she pointed to the button and told him, "I bet you'd like one of these."

Replied Kemp: "You really know how to hurt a guy, don't you?"