The LLM likely does not have write access to the database, so even if wanted to run that query it couldn't.
I'm more focused on the AI side of things. Like, if it's done as a part of the (system) prompt, it should eventually be possible to evict the command tokens when the context window becomes too large?