Your example sounds fine to me, but I wonder if maybe the real value of AI coding that you're seeing is not "AI writes code" but rather "AI ignores all the coding rules/conventions, which were being badly applied in this case."
Like, I could picture trying to write a simple tool as you describe and running into the wall of "We're an Angular shop so you need to use the framework." But the AI isn't forced to follow these rules, so it can do a decent job.
This has been the main value of AI to me. It's just like, "sorry, the machine won't let me do a refund," as an alternative to listening a customer scream that they deserve a refund.