Grammatical function is the syntactic role performed by a word or phrase in the perspective of a clause or sentence. Sometimes known as simply function.
In English, grammatical function is largely determined by a word’s place in a sentence, not by inflection (or word endings).