Precise manipulation of flexible surgical tools is crucial in minimally invasive surgical procedures, necessitating a miniature and flexible robotic probe that can precisely direct the surgical instruments. In this work, we developed a polymer-based robotic fiber with a thermal actuation mechanism by local heating along the sides of a single fiber. The fiber robot was fabricated by highly scalable fiber drawing technology using common low-cost materials. This low-profile (below 2 millimeters in diameter) robotic fiber exhibits remarkable motion precision (below 50 micrometers) and repeatability. We developed control algorithms coupling the robot with endoscopic instruments, demonstrating high-resolution in situ molecular and morphological tissue mapping. We assess its practicality and safety during in vivo laparoscopic surgery on a porcine model. High-precision motion of the fiber robot delivered endoscopically facilitates the effective use of cellular-level intraoperative tissue identification and ablation technologies, potentially enabling precise removal of cancer in challenging surgical sites.