API function query tool api