Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) narrates concerning this saying of Allah Almighty: (Allah Almighty says:) "When your Lord took from the children of Adam, from their backs, their descendants." Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) said: Allah Almighty gathered them and made them in pairs, then gave them their forms and gave them speech, and they began to speak. Then Allah Almighty took a covenant and pledge from them and made them witnesses over themselves, and said: "Am I not your Lord?" They replied: "Yes." The Lord said: "I make the seven heavens and the seven earths witnesses over you, and I make your forefather Sayyiduna Adam (peace be upon him) a witness over you, lest you say on the Day of Resurrection: 'We did not know of this.' Know that there is no god besides Me and no lord besides Me, and do not associate anything with Me. I will send My messengers to you, who will remind you of My covenant and My pledge, and I will send down My Books upon you." They said: "We bear witness that You are our Lord and our God; we have no lord besides You and no god besides You." So they affirmed it. Sayyiduna Adam (peace be upon him) was raised above them so that he could look at them, and Sayyiduna Adam (peace be upon him) saw the rich and the poor, the handsome and those of lesser form. He said: "O my Lord! Why did You not make Your servants equal?" The Lord said: "I loved to be thanked." Then Sayyiduna Adam (peace be upon him) saw the Prophets among them like lamps. These Prophets were singled out for another covenant concerning messengership and prophethood, and that is mentioned in this saying of Allah Almighty: "And when We took from the Prophets their covenant," up to: "Isa son of Maryam." He was one of those souls; Allah Almighty sent him to Sayyidah Maryam (peace be upon her). The narrator reported from Sayyiduna Ubayy (may Allah be pleased with him) that he entered her through the mouth of Sayyidah Maryam (peace be upon her).
Abdullah bin Ahmad recorded it from his teacher Muhammad bin Ya'qub al-Rabali, and he is mastur (of unknown reliability); the rest of its narrators are the narrators of the Sahih.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب التفسير / 11019