Functional gradient materials are ubiquitous in construction projects. Enhancing the theory of interaction between variable-section functional gradient beams (FGBs) and soil holds significant implications for engineering applications. Based on the variational principle and the transfer matrix method, this paper formulates semi-analytical solutions for displacement and internal force in the Timoshenko beam model (P-T model). The model features variable-section axial functional gradients on a Pasternak foundation. It accounts for the shear effects in the FGB structure and the soil's continuity and shear strength influences. Next, the semi-analytical solution is compared with finite difference decomposition results from existing studies. The comparison validates the proposed computational theory's precision and accuracy. The P-T model can degenerate to the Winkler-Timoshenko model (W-T model) when the foundation's shear layer stiffness is zero. Examining the displacement and internal force change when the beam stiffness varies along the axial direction reveals that an asymmetrical stiffness distribution on both sides of the midspan increases the displacement in the midsection. Moreover, when the beam stiffness gradient follows a Gaussian distribution along the axial direction, displacement sharply increases at the boundary position. Finally, the proposed method is incorporated with the Mindlin stress solution to assess the impact of construction on a tunnel existing within a foundation pit project in Shenzhen. We compare theoretical calculations, monitoring data, and numerical simulation results. The results show considerable agreement across the three methods. The tunnel's overall deflection follows an "M" shape, and the calculation using the variable-section FGB predicts the existing tunnel's deformation trend more accurately. This method reduces the calculation error from 35% to 8.3% in comparison to the traditional normal section beam.