The inverse problem for Thomson scattering (TS), that is, finding the electron distribution function (EDF), not restricted to be Maxwellian or isotropic, from the observation of the scattered spectrum, is addressed. Based on previous results by the authors, a new parallel FORTRAN code, INVERT, has been developed that allows to estimate the free parameters of a wide class of distribution functions by fitting experimental or numerical (synthetic) spectra using a variant of the simplex method. The application of these techniques to the extraction of non-Maxwellian or anisotropic features in the electron distribution function is analyzed in detail. The performance of the new code on noisy synthetic spectra and its capabilities to quantitatively discriminate among several competing EDFs modeling data are discussed. The issues of uniqueness (or nonuniqueness) of the inverse problem in case of multiparameter distribution functions are discussed. In such cases, the prospects of multiple diagnostics synthesis, or having several simultaneous scattering chords to remove the ambiguity in the reconstruction of the EDF, are also discussed. Some comments on the requirements of a TS system able to detect nonthermal or anisotropic effects are also included.