               // Send the request
                    xhr.send(JSON.stringify({}));
                });
            });
        });

        // Function to update agent status in the UI
        function updateAgentStatus(agentName, isOnline) {
            // Find the card for this agent
            const cards = document.querySelectorAll('.card');
            cards.forEach(card => {
                const agentTitle = card.querySelector('h2').textContent;
                if (agentTitle === agentName) {
    