Do we have any structure or API in cdb using which i can know leaf names

See for example the print_modifications examples here:

and here: