Disclosed is a thiazolidine compound of formula (I) where the substituents are as disclosed in the specification. Example of compound of formula (I) include: 1-(1-(2-(4-Oxo-2-phenyl-3-((pyridin-4-yl)methyl)thiazolidin-5-yl)acetyl)piperidin-4-yl)-1H-benzo[d]imidazol-2(3H)-one 3,4-Dihydro-3-(1-(2-(3-methyl-4-oxo-2-phenylthiazolidin-5-yl)acetyl)piperidin-4-yl)quinazolin-2(1H)-one and 3-(1-(2-(3-Isopentyl-4-oxo-2-phenylthiazolidin-5-yl)propanoyl)piperidin-4-yl)-3,4-dihydroquinazolin-2(1H)-one. Also disclosed is the pharmaceutical composition comprising a compound of formula (I) and the use of a compound of formula9I) in the manufacture of a medicament for treating or preventing headache migraine cluster headache chronic tension type headache pain chronic pain neurogenic inflammation and inflammatory pain neuropathic pain eye pain tooth pain diabetes non-insulin dependent diabetes mellitus vascular disorders inflammation arthritis bronchial hyperactivity, asthma shock sepsis opiate withdrawal syndrome morphine tolerance hot flashes in men and women allergic dermatitis encephalitis brain trauma epilepsy neurodegenerative diseases skin diseases neurogenic cutaneous redness, skin rosaceous and erythema tinnitus inflammatory bowel disease, irritable bowel syndrome, or cystitis.