How to list all defined custom metadata fields?

The first script in this post lists them all in an AppleScript choose from list. Clicking copies one meta data identifier at a time for pasting into a script.

Should be easy to change the script to do what you want.