StoryboardAI Engineering

Tool calling

The model cannot do anything itself. It asks your code to, and your code answers.

What is tool calling?

A model only produces text. It cannot look in a database, send an email or check the weather. What it can do is ask: if you describe a tool in the prompt, the model can reply with a structured request to use it.

Your code receives that request, decides whether to allow it, runs the real function, and sends the result back in a second call. Only then does the model write its answer, now with real data in front of it.

This is the difference between a chatbot that guesses and a product that knows. It is also why your code, not the model, is responsible for what actually happens.

The model asks. Your code acts. Then the model reads the result.Step 1: The model asks for a tool. Step 2: Your code checks and runs it. Step 3: The result joins the conversation. Step 4: The model is called again. Then it repeats from step 1.1The model asks fora tool2Your code checksand runs it3The result joinsthe conversation4The model iscalled againand round again
The model asks. Your code acts. Then the model reads the result.

Why does tool calling matter?

A model can only produce text. It cannot look up an order, send an email or check a calendar. Tool calling is the mechanism that connects a model to real systems, and it is the step that turns a chatbot into something that can do work. Every agent is built on it.

How does tool calling work?

  1. Your code describes each tool to the model: its name, what it does and what inputs it needs.
  2. When a tool would help, the model replies with a request: use this tool, with these inputs.
  3. Your code checks the request, runs the real function, and gets a result.
  4. The result is added to the conversation and the model is called again.
  5. With the result in front of it, the model writes its answer, or asks for another tool.

When should you use tool calling?

Use it when

  • The answer lives in a live system, not in documents
  • The assistant must take an action for the person
  • A calculation or lookup needs to be exact

Think twice when

  • The information is static and can be placed in the prompt
  • The action is so sensitive that a person must always do it

Where does tool calling sit in a real system?

The tools are functions in your own code, running on your server. The model never touches the systems behind them. Your code is the only thing that acts, which is where permissions and checks are enforced.

What goes wrong with tool calling?

  • Thinking the model runs the tool. It only asks.
  • Trusting the inputs the model supplies, especially identity. Take those from the signed-in session.
  • Offering dozens of vaguely described tools and wondering why the wrong one is chosen.

What does tool calling look like in practice?

A customer asks where order 1042 is. The model replies with a request: find_order, number 1042. The server runs the lookup and gets "shipped Tuesday, due Thursday". It calls the model again with that record, and the model writes the answer. One reply took two model calls.

Watch it happen

These stories show tool calling at work, one step at a time.