Alright, here is where I would start.
Is the check engine light on? If so, head to a parts store (I know Advanced Auto around here will do this) and ask for them to hook it to a computer to see what the code is. Make sure you write it down if there is any.
If there is any either shoot me a PM of what it is or even google "02 Mazda Pretege 5 code (whatever it is)" and see what you come up with.
Also, how many miles are on the car? How well have you maintained it?
If its an '02 and has over 100k miles on it I am already leaning towards spark plugs and wires. Bad spark plugs and wires can lead to a misfire that can make a vehicle idle lower than normal, and occasionally will go away as the RPM increases (I've seen this a few times, but there are a lot of other variables that play into this). Since you said its also loud/clunky/rumbly at idle I'm really leaning towards this as the first thing to check.
There are a few other things it could be, but this is starting with the basics. Feel free to message me the code if/when you do get it looked at. I'm more than happy to help.