What role do tonsils play in the immune system?

Doormen. I tell my patients that tonsils are like doorman at a fancy hotel. They are there to alert the body to "what's coming in". They say to mr. Pea and mr. Carrot come on in and to mr. Bacteria and mr. Virus they say please have a seat over here while they contact the bodies police department. Sometimes however these "doorman" become lazy, fat and criminals. At that point they the body more harm than good and we fire them.