This demo shows you how to use monitor tag and render chat agent list directly. In this example, mylivechat ID is 68268000. You need to replace it with your own mylivechat ID.
chatapi.aspx
MyLiveChat.Departments[i].Agents
MyLiveChat.Departments[i].Agents[j].Online
MyLiveChat_OpenDialog()
Edit/Test this code now