how can get tool position coordinate through grbl source code

Na, it's your job as a forum member to do the job for the TO ... shake head