A Sutton on Sea man had warned NHS staff that he planned to carry out a stabbing, Lincoln Crown Court was told.
John Froggatt made the threat during a call to the NHS 111 number telling the call taker that he could see people outside his flat.
Andrew Scott, prosecuting, said that the police were called and Froggatt was seen still talking on his phone as he left his home.
He was detained and when he was searched he had a butterfly knife on him.
When he was interviewed later by the police, he admitted making the call but could not remember what he had said.
Froggatt,40, of High Street, Sutton on Seaadmitted possession of an offensive weapon in a public place as a result of the incident in August.
He was given a community order with 12 months supervision and a six month alcohol treatment order.
Saleem Khan, defending, urged the judge to follow the recommendation of a probation report that Froggatt should get a community penalty.
Recorder Michael Elsom told him: “You have a problem with drink.
“You are 40 years of age and have no relevant convictions. The last place a man like you should be is before any court.
“I don’t regard you as a danger to the public. What you need is help, supervision and guidance.”