📜 What do the documents say?
The building stands in the Şamlar quarter, which is why it is also known as the Şamlar Mosque.2 It was built by İyas (Ayas) Ağa, Lesser Agha of the Gate (Küçük Kapı Ağası) to Bayezid II.3 It has no inscription; according to Hüseyin Hüsâmeddin it was built in AH 900 (1494–1495).2 Its endowment deed bears a date in the same year: 28 Jumada al-Akhira 900 / 26 March 1495.1
One source gives a different Hijri year. Fuat Er gives the year of construction as 1495 but writes the Hijri year as 901.3 Since AH 901 began in September 1495, the year that fits the date of the endowment deed is AH 900; the Gregorian year 1495 is common to both reckonings.
The building is a small complex made up of a single-domed mosque, a madrasa and a primary school (sıbyan mektebi). Because students were to be taught in the madrasa, rooms were built adjoining the mosque.1
There was a mosque here before. When the mosque built by Emir (Melik) Gazi in the Danishmendid period fell into ruin, Ayas Ağa, the Agha of the Gate, had it rebuilt as a complex in 1494–1495.4
Its madrasa is recorded separately. The madrasa, on the north bank of the Yeşilırmak and to the north of the Şamlar Mosque, is built of rubble stone; the records state that the mosque was used as a classroom.5
According to the sources, the same building is known by six different names.