A tool breaking in the midst of a CNC ... has posted are meant specifically for a Haas mill, a similar approach should work for most CNC mills. You’ll need an unused port for the limit switch ...