Right, so OP wants to treat Bard as an API. I don't dispute the thought, though it does run counter to conversational models. I'm slightly anxious about all the rogue conversational text parsing to use LLM's as an API.
The only reason they’re having a problem is due to the way they’re requesting this. OpenAI’s GPT can follow schemas for responses and issue commands or API requests if you tell it how. I’m sure Bard can do the same with the right request structure.