Tool calling was invented approximately 1.5 years ago to solve the training date limitation problem in LLMs, where models could only answer based on their training data. The breakthrough involved expanding prompts to allow LLMs to respond in XML format requesting tool calls (like web search) instead of providing direct answers. This enabled LLMs to access real-time information by calling external APIs, which the application would execute and return results to the model for further processing. This innovation evolved through phases: from manual XML handling to framework-based solutions like LangChain, then to API-integrated tool calling by OpenAI and Anthropic, and is now advancing toward user-selected tools.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
The First Tool Call: The Hack That Sparked Agentic AIAdded:
[music] >> Hello everyone. Welcome back to my code to care video series. Today I'm going to do what I think is an interesting topic, which is taking through the very first tool call as part of an agentic workflow. So as a reminder, when we talk about agentic AI at least when I talk about it, there are three three characteristics of an agentic workflow. One is that there's multiple LLM calls.
So this might be competing agents or a writing agent and a critiquing agent and then a finalizing agent or something like that, but it's some kind of multi-step workflow usually with multiple LLMs in the in the process, at least multiple calls.
The second characteristic is tool calling.
So instead of just the LLMs writing back they're actually calling APIs or updating databases or launching browsers or doing things. And that's called tool calling and we'll zero in on that today.
And then the third characteristic is um a non-deterministic workflow.
So most softwares kind of deterministic.
You do A, B, then C and then if this then do D, otherwise do E kind of thing, but in agentic workflow you're letting the LLM decide what to do next based on, you know, the response from the prior tool call or based on something else that it's finding in the environment. So the workflow, the steps are really decided by the LLM. So that's what agentic workflow is all about. Now this tool calling was invented like a year and a half ago or so, so it's not too too old and it has a an interesting start to it, which I'll tell you about tell you about now.
Let's take the question that you might ask an LLM.
What is the current population of Boston?
You may recall how LLMs used to answer this question.
Uh they might say um well, I I know the population as of my training date last year, uh but I don't necessarily know the current population.
So, LLMs were kind of um restricted from doing current news and current events and and uh and things like that by um by this training date uh problem. All their answers had to come since you from their training and from their weights.
But, somebody came up with this very good idea, which is uh letting the LLM call tools. So, basically what they expanded the prompt and they said uh either answer the question that I'm passing you from the user, or if you'd like to do a tool call, then respond back in XML.
And the XML should look like um I'll show you the full prompt in in a moment. I'll show you a screenshot of it. But, you're basically requesting a tool call like web search.
Uh and I'm giving you one tool in this case. It's called web search. And if you'd like to do a web search, respond back in XML with what um the name of the tool and then the arguments to the tool.
So, what would you like to search for?
So, it might be population of Boston.
And I will call the tool for you.
I will get the results, and I'll send you back the results, and then you could try again to answer the question. And if you'd like another tool call, uh go ahead and and do that. Here are the tools that you have available to you.
So, instead of the LLM writing a prose response back, it wrote XML back. Then you as an application parse that XML, ran your tool, took the answer, and gave it back to the LLM. So, this one little technique um basically allowed LLMs to sort of get around that training date problem and be able to answer very current questions. And so, this was kind of the invention of the or the very first tool call technique was was web search.
So, let me now show you what this tool call looked like. And you can see you're telling the LLM you have access to the following tool, and then you describe the tool. In this case, it's just one tool, but eventually it would become multiple tools. If you'd like to use the tool, then respond back in XML. If you don't need to use the tool, then then then just answer the question. So, that was basically the first tool call. And let me kind of diagram out the flow now.
Okay, the flow is this. You have your application that um that took the user question.
Might be a chat chatbot type of thing.
Um you called the LLM with that longer prompt. It has the user's question, and then it has a list of tools. In this case, the LLM would either try and answer the question if it thinks it's current enough, or it might say respond back in XML. I would like you to call this tool.
So, let's do the scenario where it responds back with a tool call request.
So, you would take that you'd recognize that it's XML. You would parse it, and then you would call the tool, which is web search in this case.
Now, all of us know web search from going to google.com, but you can actually call it uh through a Google API, as well. So, imagine there's not a user interface, you're just calling Google and then getting a text file back of the results. So, you take those results back from your Google call.
And then you send them back to the LLM, just like a chatbot history.
Like you're Like you're doing the search and you're sending the Google search uh results back to the LLM. And the LLM might want to do another tool call.
Maybe the search results weren't good enough, or maybe they want to ask for the direct population versus the kind of wider city population or or something like that.
Uh so, at any rate, the LLM might request more or might just answer the question, and then you'll recognize when you get the answer back that it's not XML, and you'll present that answer to the user. So, um so, that was the very first uh very first tool call was to solve that that problem. Now, tool calling has evolved. This whole thing is only like a year and a half uh old, but tool calling has evolved a little bit.
So, phase one was this, where we were just asking the LLM to write XML and you were doing all the work associated with packaging up your tools and asking for results.
Phase two is there were these frameworks, um the most famous is something called LangChain frameworks that did the XML for you. So, the framework you'd say, "Here are my tools." And the framework would add the XML request uh when it got uh a response back from the LLM, it would parse it up for you, might even call the tool uh for you, that kind of thing. So, it kind of took care of this um you know, the messiness of the XML. And then uh phase three, which is kind of the phase that we're in, that OpenAI and Anthropic added tool calling to their APIs. So now when you call an LLM through an API, you can say here are my tools.
Here's the format that I would like.
Here's the arguments for my tools.
Here's how to use them.
And then the APIs kind of take it take it from there.
So that's basically how it got added. And then these companies have trained their LLMs to be very good at tool calling.
So so that's been one of the training ambitions the last last few years is is to improve the tool calling ability of these models.
And then the so far this is still very non-user-oriented, very programmer-oriented. But phase four, which is what we'll soon encounter, is that user picks tools.
So as you use an AI system, it'll give you a list of tools and you could just pick those those tools and then the rest will be taken care of for you. So in these cases you have to write the tools yourself. In that last case, you'll have a grab bag of tools that you could pick from and your AI system would be able to draw upon those tools in terms of getting your your tasks done.
So I hope so that's that's the quick history of tool calling. It's not a very old old history, but but I think it has an interesting start. It was a great idea to ask the LLM to produce XML instead of an answer. And then it just opened up a whole world of being able to get more things done, being able to be current with LLM answers.
And now we kind of have this gigantic AI explosion that's partially based on this this very good idea.
So I hope that was interesting. Until next time. Bye.
Related Videos
OpenHuman VS Hermes AI: Who Wins?
JulianGoldieSEO
285 views•2026-05-29
Long-Running Agents — Build an Agent That Never Forgets with Google ADK
suryakunju
142 views•2026-05-30
This computer is made from real human brain cells. And you can buy it.
Talktmsmedia
3K views•2026-05-28
BREAKING: Microsoft’s New Image Generating Model Beat Out GPT 1.5 and Nano Banana 2
aimmediahouse
122 views•2026-06-03
I Made the Same Anime Fight Scene in Every AI Video Generator
NobleGooseAnime
295 views•2026-05-30
Nvidia Bets Big On AI PCs | New Chip To Power Windows Laptops | Technology | AI Updates | N18S
cnnnews18
3K views•2026-06-01
I Tested NEW Opus 4.8 on Four Projects (Updated LLM Leaderboard)
AICodingDaily
298 views•2026-05-29
3D Platformer Update - NO CAPES
SolarLune
294 views•2026-05-30











