A young man accused of trying to rob a Melbourne service station claims he was just playing a harmless joke on the cashier.

Binyam Teklemariam, 21, allegedly walked into a Footscray petrol station on Sunday with his face concealed and demanded money, before saying he was just kidding as the staff member hit the panic button.

But Melbourne magistrate Franz Holzer on Wednesday called Teklemariam's defence "very flimsy".