How can i detect what RuleTile is on my mouse position?

Hey i am working on a 2d game and i would like to detect the specific ruletile that is under my mouse. For example i want to drop a seed when i break a dirt tile but when i break a stone tile i dont want to drop anything. I know how i can get my mouse position, but i dont know how to detect what ruletile is under the mouse.