I'll add my 2 cents here to the conversation. We do a lot of customization to our machines here. We make our own autodoors and pneumatic pallet unclamp systems, etc. If we decide to make it ourselves versus buying form the OEM or aftermarket usually is a factor of time and money. If the solution will take too long form outside or if the cost is just too high we will do it ourselves. That being said, some things to consider when doing yourself are;
1. Integration. Somehow the machine needs to initiate the function and in a lot of cases needs confirmation that it has happened. For a homebrew tool break check that is not using a machine HS skip cycle you would need to tell the device to check. This could be done with M codes or D print. If you want feedback you need M codes, Drpint is only one way. Modern controls have other possible means, Okuma API, Fanuc FOCAS, etc. Then the device needs to be able to receive that communication, 24V inputs, RS232, etc.
2. Interface. How does the device know a tool is broken. In the idea of using a camera you would need and interface that can record tools and AI that can compare. The control would also need to tell the device what tool it is comparing to.
3. Testing/reliability. If you are making a "new" device/process to check tools, how do you make it safe? When have you tested enough to be comfortable running unattended? When I design/build add on devices for our machine I rely heavily on integration and feedback to the machine/robot. I want to have multiple steps that can confirm success rather than rely on timers/dwells and hope all is good.
We have 12 cnc's here that are all automated and run up to 20 hours a day unattended. We go through a fairly rigorous testing process before we just turn it loose overnight. The revenue produced from these machines at night is great and allows for some development time. If you are a small shop/hobbyist you may have more time than dollars to add an option.
If I had to make a low cost solution I would probably look at a very low cost PLC from AD combined with a low cost laser like in the link below. You would probably need a small air jet to keep the laser lens clear. process operation would be;
Position tool in laser beam.
Send Mcode from machine to PLC to initiate.
PLC answers back if tool is good, if not trigger alarm.
If your machine has Mcodes you could probably make this work for < $400. If no Mcodes you could Dprint to the PLC and initiate that way, then M00 the machine. Wire PLC into Cyclestart and Estop. If tool is good PLC hits cycle start, if tool is bad PLC hits Estop.