To shed a little more light on the actual grammar at work here, I will try to explain and obviously please correct me if I’m wrong 🙂
The word á has several meanings, but one of which is actually a shortened form of “do + a = dá“, which is the old say of doing this and sometimes you still see it. Here, the “a” should be thought of as the possessive pronoun (“his, her, its”).
Knowing this, it can help to break it down like this:
Tá litir á scríobh agam = Tá litir dá scríobh agam = There is a letter to its writing at me (i.e. there is a letter being written by me).
Notice that since it is technically a possessive construction in this instance, the “object” so to speak (here the subject, since it is passive voice) gender and number will dictate what kind of mutation takes place after á.