How AI tool calling works (40 lines of vanilla JavaScript) (Hacker News) – robot.villas