Graphite carbon nitride (g-C3N4) is a two-dimensional nano-sheet with electronic properties, which shows unique characteristics with high chemical and thermal stability in its structure. The functionalization of these compounds through covalent bonding is an important step towards significantly improving their properties and capabilities. To achieve this goal, a novel strategy for the covalent functionalization of Fe3O4@g-C3N4 with thiamine hydrochloride (vitamin B1) via cyanuric chloride (TCT), which is a divalent covalent linker, was presented. The efficiency of Fe3O4@gC3N4@Thiamine as a heterogeneous organic catalyst in the synthesis of spirooxindole-pyran derivatives and 2-amino-4H-pyran under solvent-free conditions was evaluated and the yields of high-purity products were presented. In addition, easy recycling and reuse for seven consecutive cycles without significant reduction in catalytic activity are other features of this catalyst. Moreover, the performance of the prepared sorbent in the microextraction technique (herein, magnetic solid phase extraction) was studied. The tebuconazole was selected as the target analyte. The target analyte was extracted and determined by HPLC–UV. Under the optimum condition, the linear range of the method (LDR) was estimated in the range of 0.2–100 μg L−1 (the coefficient of determination of 0.9962 for tebuconazole). The detection limit (LOD) of the method for tebuconazole was calculated to be 0.05 µg L−1. The limit of quantification (LOQ) of the method was also estimated to be 0.16 µg L−1. In order to check the precision of the proposed method, the intra-day and inter-day relative standard deviations (RSD%) were calculated, which were in the range of 1.5- 2.8%. The method was used for the successful extraction and determination of tebuconazole in tomato, cucumber, and carrot samples.