Glyphosate (GLY) is a widely used herbicide, and its potential health and environmental risks require the establishment of efficient residue detection techniques. In the design of photoelectrochemical (PEC) sensors based on CuTCPP, it is necessary to increase the visible light absorption efficiency and promote the separation of photogenerated electron-hole, as well as balance the adsorption and desorption of GLY to maintain excellent reversibility and responsiveness. In this work, the synergistic effect of type-II heterojunction g-C