Police approached 24-year-old Yashaar Hussain's car after it had been spotted parked at the junction of Cloth Hall Street and Crown Street in the city centre, Leeds Crown Court was told.
Katy Varlow, prosecuting, said officers searched the car after smelling cannabis during the incident at around 11.30pm on July 28 2019.
Officers found bags of cocaine, ecstasy, ketamine and cannabis worth a total of £540 in the car along with three mobile phones and £975 cash.
Developers admit planning breaches in construction of Leeds retirement flats
Paedophile arrested at Leeds Bradford Airport after travelling from Ireland to meet ‘13-year-old girl’
Met Office issues thunderstorms and torrential rain weather warning for Leeds as heatwave comes to abrupt end
Major new £85m build-to-rent Leeds city centre development to go ahead following approval
How to see Lancaster bomber and Spitfire flypasts near Leeds at Yorkshire Wartime Village
Police also found a metal bar in the car.
The mobile phones were for a dealer line and contained messages connected to drug dealing.
One Nokia mobile phone had 418 messages sent and received to and from the same number within a 23-day period.
Hussain, of Carr Manor Road, Moortown, was jailed for more than two years after admitting two charges of possessing class A drugs with intent to supply and two charges of possessing class B drugs with intent to supply.
Mitigating, Charles Blatchford, said Hussain comes from a "good family", adding: "He said he was smoking cannabis on credit. The debt has built up and the dealer said 'I'm not interested in your money, this is what you are going to do for me.'"
Mr Blatchford added: "He is ashamed of what he has done and the situation he has got himself into.
"He is embarrassed and feels remorse for the shame he is going to bring on his family."
Hussain has one previous conviction dating back to 2018, for criminal damage.
The court heard Hussain was in possession of cocaine with a street value of £120, ecstasy with a street value of £260, ketamine worth £140 and cannabis worth £20.
Jailing Hussain for two-years-and-one-month, Judge Robin Mairs told him. "You also had a metal bar with you - I have no doubt as a protective weapon - and three phones. You were operating as a mobile dealing unit. I accept that you were, in essence, a foot soldier."