Build a Basic AI Agent in TypeScript, Part 2: Tool Calling and LLM Intent Routing

Add a weather tool, pass tool definitions to the model, and let the LLM decide when to call tools versus answer directly