Most of our current understanding of the planet formation mechanism is based on the planet metallicity correlation derived mostly from solar-type stars harbouring gas-giant planets. To achieve a far more reaching grasp on the substellar formation process we aim to analyse in terms of their metallicity a diverse sample of stars (in terms of mass and spectral type) covering the whole range of possible outcomes of the planet formation process (from planetesimals to brown dwarfs and low-mass binaries). Our methodology is based on the use of high-precision stellar parameters derived by our own group in previous works from high-resolution spectra by using the iron ionisation and equilibrium conditions. All values are derived in an homogeneous way, except for the M dwarfs where a methodology based on the use of pseudo equivalent widths of spectral features was used. Our results show that as the mass of the substellar companion increases the metallicity of the host star tendency is to lower values. The same trend is maintained when analysing stars with low-mass stellar companions and a tendency towards a wide range of host stars metallicity is found for systems with low mass planets. We also confirm that more massive planets tend to orbit around more massive stars. The core-accretion formation mechanism for planet formation achieves its maximum efficiency for planets with masses in the range 0.2 and 2 M$_{rm Jup}$. Substellar objects with higher masses have higher probabilities of being formed as stars. Low-mass planets and planetesimals might be formed by core-accretion even around low-metallicity stars.