Your code only takes actions prescribed by you. The agent does not; it picks the tool. I thought this was too obvious to point out.