It depends on عَامِل
عامل is a word which effects a change in the case-ending of a neighbouring word in a sentence, e.g., in في بيتِ المدرسِ, the word في has changed بيت from مرفوع to مجرور, and in قرأتُ كِتابَ عمر, the word قرأ has changed كتاب from مرفوع to منصوب. In the first example في is عامل.