We use the solution to Maxwell's equations in a rectangular single-mode waveguide with multi-mode boundary conditions at its flanges to determine the parameters of the inclusion. The well-posedness of the inverse problem is studied using explicit expressions for the S-parameters of the waveguide when the inclusion is a plane-parallel dielectric slab. The methods of reconstructing permittivity from the measured (experimental) data must be stable and well-conditioned. The importance of these demands is discussed taking as an example the determination of real permittivity from noisy measurement data of the transmission coefficient of the principal waveguide mode. Generally, this problem is unsolvable because the range of the function to be inverted forms a set of measure zero on the complex plane. In addition, the occurrence of self-intersections of the parametric curve leads to non-uniqueness of the solution to the inverse problem. Therefore, approximate methods of the permittivity reconstruction in the vicinity of such points may be unstable or ill-conditioned. In our study, we present several examples of such algorithms. We demonstrate that the method of least squares applied for reconstructing permittivity of the inclusion from multi-frequency measurement data is a stable algorithm for the solution to this inverse problem. This approach does not use a priori estimates for the sought parameter and information about the location of singularities of the parametric curve. We determine the interval of variation of the condition number for the method of least squares and show that this quantity decreases as one of the following parameters increases: the width of the dielectric layer, the measurement frequency band, or its distance to the lower cutoff value. Using these results, we estimate the rate of convergence of the approximate solution to the exact value of the sought parameter when the quality of the measurement data is improved and show how to choose optimal parameters of the experiment and the measurement setup.