The only way to know is to purchase a pill test kit. You should test every pill before you take it.
I'm assuming that you're talking about a capsule with little chemical in it. That could literally be anything. Your experience doesn't sound much like MDMA to me but its possible that you got a very low dose of MDMA.
Testing is pretty much mandatory. A lot of the things that are added to pills can actually be deadly.
I agree with MagickalKat777, you have to test every pill!
A testing kit is a small price to pay for your health and well being. I'm glad this pill didn't turned out to be a random chemical that could potentially be dangerous.