Accessing History Providers Available on Gateway Using Scripting Function

I’m trying to grab a tag and see what gateway the tag is on and then find what history providers are available for that that gateway using the scripting language but I can’t seem to find any system functions that will help?