Fanuc MDI -AUTO distinction

The tool breakage detection subprogram O9002 is embedded in tool change program O9001. The task is to allow the execution of O9002 while in AUTO mode, but skip it while in MDI. Are MDI / AUTO modes assigned to any 1000 series variables ? Another ideas ??