I think it depends on what the sensor gives you in the “tilt” value, for example, the SmartThings multi-purpose sensor uses the Three Axis capability which gives the position of the device in the X, Y and Z vectors, thanks to this capability (and using the device as a garage door sensor) we’re able to determine if the door is open or closed depending on its position.
If none of the capabilities included in the reference meets your requirements, you can create a Custom Capability instead.