I think what you are looking for is the $words
variable. This is an array of all words specified on the command line that magically exists inside completion functions.
Where is that documented? There are some passing references in man zshcompsys
that I would have missed were I not specifically looking for them. However, I found it more clearly highlighted on this website.