Script access to SQLTag datatype

I would like to be able to detect datatype in script/bindings. Is there a function that gives me the datatype, given a tag path?

Thank you…