Only as an adverb
[1] [Only Sue and Mark] bothered to turn up for the meeting.
[2] [Only an idiot] would do that.
In both examples, "only" is an adverb functioning as a focusing modifier in the bracketed noun phrases.
Focusing adverbs modify a wide range of constructions, including noun phrases, but they do not modify nouns or nominals, as opposed to noun phrases.
[3] I don't eat meat, but [only fish].
Here, fish is an NP consisting of just a noun. You could have [4] but not [5]
[4] I eat meat, but [only this kind of fish].
[5] * I eat meat but this [only kind of fish].
In [5] "kind of fish" is a nominal and hence the sentence is ungrammatical.
However, in an appropriate construction "only" can modify a nominal, in which case it is not an adverb but an adjective, as in [6]
[6] My [only reservation] is the cost.
where "only" modifies the nominal "reservation".
Only Sue and Mark bothered to turn up for the meeting.
Here, we can replace "only" with merely, solely, exclusively - You will note all are adverbs: we cannot use mere, sole, exclusive.
Only fronts the whole main clause as a free modifier. The same applies to the second.