as some people have correctly stated above mech cage length determines the overall capacity of the mech to tension and take up different chain slack…
this is why 3×9 and 3×10 mtb set have generally have a long chain as the amount of excess chain to tension varies greatly with the different gear ratios combos
max sprocket size is a function of the mech parallelogram (ish) action…
obviously for max efficieny this arc should be suited to the arc of the cassette cluster… road mechs are suited better to cassettes with small changes in sprocket size whereas touring/mtb mechs are suited to managing a wide change in sprocket sizes…
if you have a wide range cassette say 11-32 or 11-36 etc and also do not require a lot of chain slack to be taken up as you are running a single chain ring or two closely spaced chainrings on a double then you would be best using a short or med cage from a mtb groupo..
not saying you can not get other components to work, but best shifting from parts designed for the job.
you could of course if you have the road mech already just fit it and try..