Is there a way to get skeletal bones?

I am trying to generalize bones under groups, like they way the editor displays them in Skeletal Asset:

I want to make a function with input of a Bone name, so that when i search for a Bone name say “spine_01”, i want to be able to get its info, like its parent “pelvis”.

And is there also a way to display them in editor as a field where i can choose a bone.