Assuming the thin flux tube approximation, we introduce an analytical model that contemplates the presence of: a non-isothermal temperature; a varying magnetic field and a non-uniform stratified medium in hydrostatic equilibrium due to a constant gravity acceleration. This allows the study of slow magnetoacoustic cut-off periods across the solar transition region, from the base of the solar chromosphere to the lower corona. The used temperature profile approaches the VAC solar atmospheric model. The periods obtained are consistent with observations. Similar to the acoustic cut-off periods, the resulting magnetoacoustic gravity ones follow the sharp temperature profile, but shifted towards larger heights; in other words, at a given height the magnetoacoustic cut-off period is significantly lower than the corresponding acoustic one. Along a given longitude of an inclined thin magnetic tube, the greater its inclination the softener the temperature gradient it crosses. Changes in the magnetic field intensity do not significantly modify the periods at the coronal level but modulate the values below the transition region within periods between $sim [2,- 6],$min. Within the limitations of our model, we show that monochromatic oscillations of the solar atmosphere are the atmospheric response at its natural frequency to random or impulsive perturbations, and not a consequence of the forcing from the photosphere.