Questions like an é Tomás Ó Ceallaigh do bhí ann? follow the ordinary syntax of the copula. However, what? and who? questions form a general exception to the syntax of the copula. This is because there is no real predication: the question asks for the predicate, but doesn’t really give one. The interrogative takes the place of the predicate, and is placed first in the sentence, and the copula is generally not expressed.
In some questions, like cad é an rud é sin? general syntactical rules relating to the copula are not violated. But where there is a separate copula that follows the question word, it is not the main verb at all. For example cad is ainm duit? This appears to have the subject ainm duit directly next to the copula, but it is an elliptical construction, containing an unexpressed relative. Cad? is the predicate and (an ainm a is) ainm duit is the subject, but because there is really a relative clause in there, the subject of the expressed is is the implied relative particle and the predicate of the expressed is is ainm duit.