Speaking as a former "gate agent"----actually a cross utilized aka I can do anything agent---- I can understand why some are rude... especially towards pilots. I have been sworn at more by pilots because I did something in a way that they didn't like... blah blah blah... in fact I was sent in before a review board because a CA claimed that I took too long to pull the jetbridge up to the aircraft (mind you this was on a winters night in ND.... get it?)
Basically be nice and if they want to act like a pile of $h!t..... just walk away.
BTW DC-9 CA's at a certain company really need to work on their social skills and stop screaming so dang much.