Add getAvailableMessages function