CHEVY EGR

I tried to get my 98 tracker smoged but was told the EGR sensor needed to be replaced at a cost of 500 dollers. I thought that they were only EGR valves. Do I have both? And do I have to replace both. Or can I just clean up th old one?