Mayor Vincent C. Gray on Tuesday pushed back against suggestions that the District is heading in the wrong direction by releasing results from a new service that allows residents to grade the performance of city agencies.

The Grade DC initiative , which officials call a first-in-the-nation evaluation tool for local officials, found that residents rate five key agencies as average. Improvement was also perceived over the past month.

Last month, partnering with a a private firm that tracks community blogs, Facebook, Twitter and an online Web site for citizens’ reviews, the city began tracking residents’ impressions of public works, transportation, motor vehicles, parks and recreation, and business licensing agencies.

All scored B’s or C’s in July. And every agency — except for the Department of Motor Vehicles, which got a C-minus — saw an improvement over its initial grade after the program launched in early June.

“We think grades will continue to go up,” said Gray (D), adding that he “won’t be satisfied until every agency gets an A.”

Gray released the grades, which he stressed are based on only seven weeks of data, a week after a Washington Post poll found that public approval of city services has declined as the mayor endures a federal investigation into his 2010 campaign.

The Post poll found that 45 percent of respondents think the District is on the wrong track, up from 36 percent 14 months ago. Slightly more than half also said Gray was doing a not-so-good or poor job improving city services.

The poll underscored Gray’s challenge in convincing District residents that the pace of reforms launched by former mayors Anthony A. Williams and Adrian M. Fenty has continued after two council members resigned in disgrace and two Gray campaign aides and one associate were charged with criminal wrongdoing.

With the city’s homicide rate declining, new apartment and office buildings rising and many neighborhoods relatively trash-free, many community and business leaders say the District continues to make strides.

“What is driving residents’ views is not the actual services, but their views of the mayor,” said D.C. Council member Jack Evans (D-Ward 2), adding that “I really, really believe we have the best agency heads” since he got on the council 21 years ago. “The agencies are working, very, very well,” said Evans, a likely candidate for mayor in 2014.

After Gray scrapped Fenty’s data-driven Capstat program, the mayor unveiled Grade DC this spring. The city is spending $175,000 a year through a contract with newBrandAnalytics, a District firm that specializes in “social market intelligence.” Kristin Mulner, the company’s chief executive, said the District is the first local government in the nation to use such a grading system.

City officials said grades for several agencies improved this month because residents appeared satisfied with the city’s response to the severe June 29 storm that knocked out power to more than 60,000 residents.

“We did a lot of cleanup, and people realize the value we provide,” said William O. Howland, director of the public works department. Customers gave DPW a B in July, up from a C-plus last month.

The departments of transportation and consumer and regulatory affairs scored a C-plus in July, up from a C-minus. Parks and recreation received a C, up from a C-minus in June.

Bradley A. Thomas, an Advisory Neighborhood Commission member in Truxton Circle, said he thinks that agency grades will continue to improve.

“There are still areas where we would like to see improvement, but I don’t think I would join with the concept that things are going downhill,” Thomas said. “We have a new park in the neighborhood . . . and concerns that were not addressed for years [that] this mayor has responded to.”