Locals were mostly outnumbered by city officials and City Hall staff members. At one point, in the large blue room, there appeared to be only two dozen residents and roughly three times as many city workers.

Over the course of a four-hour event, 215 residents passed through, according to the mayor’s office. While he was there, Mr. de Blasio talked both to individuals and to groups.

“We got a coalition here,” Mr. de Blasio said to Paul King, 50, a businessman in the Tottenville neighborhood who approached the mayor with ideas for dealing with abandoned homes and was then joined by the Buildings Department commissioner, the first deputy mayor and staff members. “You may get the whole government to move,” Mr. de Blasio said.

Mr. King appeared encouraged but also befuddled by the experience. “I just wanted to tell him my idea, see what happens, see what transpires, see if he’s not just here for politics but really gets through to people,” Mr. King said after speaking with the mayor. “What he just did, for people to call me, that’s fine. But if I walk out of here — so far, nobody got my number.” (Mr. King later got a card from an official with the Department of Housing Preservation and Development who told him to call.)

The mayor, who lives in Gracie Mansion in Manhattan, arrived at the event after a morning stop in Brooklyn at his regular gym, the Prospect Park Y.M.C.A. While he was there, his staff sent an email advisory saying the constituent event had been rescheduled to 11 a.m., from 10:30. But things seemed to change again after a reporter arrived at the gym.

Mr. de Blasio soon appeared on the sidewalk in shorts and a T-shirt, taking a suit from the back of his S.U.V. and then going back inside. At 10:03 a.m., he reappeared, wearing the suit and a golden tie; he hopped in the vehicle and sped off, and he was in Staten Island Borough Hall by about 10:30.

Mr. DeBlasio has often been criticized for tardiness, but Jessica Ramos, a member of his staff, said later that the mayor should get credit for being half an hour early to the rescheduled event.