So I like to do all the edge case handling and validation etc via a helper function, and the agent is simply instructed to call the function to do something. It is extremely powerful and a completely different way of automating things. I am constantly forced to re-think how computers are supposed to work and its limitations.