In addition to the above answer, here’s a tip for peeking at the value of any property from a piece. Use trait position or restrictions to prevent a cheating loophole if that is a concern.
Core vassal also has a console level property peek function but this is disabled for multiplayer games which seems to include all the preset scenarios that I tried to test it with.