For my LGB model railway I had to make some rack railway sections, but the original coupling hooks will detach, because the toothed racks will lift the downward part of the hook, so the carriages likely will detach, just very similar to the uncoupling Rail.
Märklin offers some hooks which should be compatible for Gearwheel operation, but these are very expensive.
I've uploaded two models, V1 is moreless the original shape (which can be bought from Märklin), V2 has a slightly increased hook in comparison to the original models. (V2 worked for me much better, because some little hills under the rails caused a detachment-issue, when the spring was a little bit worn out)
Both models are compatible with the uncoupling Rail, too. (So they detach, when they should :) )
The author marked this model as their own original creation.