EGR valve has a vacuum hose attached to it, with engine idling remove this hose and put your finger over the end of the hose.
Do you feel a vacuum on this hose, is it sucking air in, it shouldn't be?
Does engine now idle better?
If so then yes your EGR solenoid may be bad.
Follow that vacuum hose back to EGR solenoid, it will have an electrical connector and another vacuum hose attached, that hose goes to intake manifold, it is the source of the vacuum pressure.
EGR solenoid opens and closes to pass that vacuum pressure to the EGR valve.
The EGR(exhaust gas recirculation) system helps reduce NOx emissions when engine is under a load.
NOx is generated when cylinders run hotter than normal, if exhaust gas is added to intake during this time cylinder combustion slows down so heat goes down, reducing NOx, it also reduces "pinging/knocking"
The computer controls the EGR solenoid, the electric connector.
When you are driving and open throttle, engine load increases and computer will start opening EGR solenoid to pass vacuum to EGR valve.
Computer pulses 12volts to EGR solenoid to open it a little or alot, so open EGR valve a little or alot.
But at idle there is no reason to use EGR solenoid or valve, so there should be no vacuum at the valve, if there is then exhaust gases coming in would foul up the idle.