In this work we address the application of the method of fundamental solution (MFS) as a forward solver in some shape optimization problems in two- and three-dimensional domains. It is well known (Kac's problem) that a set of eigenvalues does not determine uniquely the shape of the domain. Moreover, even the existence problem is not well defined due to the Ashbaugh-Benguria inequality. Although these results constitute counterexamples in the general problem of shape determination from the eigenfrequencies, we can address simpler questions in shape determination using the MFS. For instance, we apply the MFS to build domains that include a specific finite set of eigenvalues, or that have an eigenmode that verifies some prescribed conditions-as a particular case, an eigenmode that defines a certain nodal line.