I would second the "dont bother with goodreads involvement" when it comes to tags/genres.
I'm also confused as to what your LLM is actually doing - you give it tags and it gives tags back? That seems a bit of a strange thing to try to be doing - surely that is just garbage in, garbage out? Kovid's suggestions seem more like what I too would think an LLM would be used for - a case of "tell me something I don't know", not "something I know already".
Glad you found some plugin code useful as a starting point though