Hi,
Check the scripting class com_vmware_cis_tagging_tag__association. It has a method list_attached_tags(object_id), which you can invoke, passing the ID of your VM as a parameter, and it will return an array with IDs of all tags attached to this particular VM.