Varun Vemulapalli

Day 37 of 100 · Phase 5: How AI agents work

Tool use / function calling

2 min readBy Varun Vemulapalli

An AI model can't check your order status. It can't look anything up at all.

So how does a store's assistant tell you your package arrives Thursday? It asks your app to do it. That's tool use, and it's the hands of every agent.

Video explainer · 1:51
Key takeaway

With tool use, the model decides which function to call and with what inputs, and your app runs it and returns the result, so answers come from real systems.

Day 37 visual: Tool use / function calling
The visual from the original post.

The concept

Tool use, also called function calling: the model can request that your app run a function (a small piece of code that does one job) and send back the result.

Three things to know:

  • Your app describes the tools up front: a name, a plain-English description and the inputs each one needs, written in a JSON format (Day 26).
  • When a question needs a tool, the model doesn't answer yet. It replies with a structured request: which tool, with which inputs.
  • Your app runs the tool, not the model. Then it hands the result back and the model writes the answer.

This is the "act" and "observe" of the agent loop (Day 36).

Walkthrough: "Where's my order 4512?"

An online store gives its assistant one tool:
get_order_status(order_id): "Look up the shipping status of an order."

Step 1: the customer asks: "Where's my order 4512?"

Step 2: the model reads the question and the tool list, and replies with a call instead of text:
get_order_status(order_id="4512")

Step 3: the store's app sees that request, checks this customer owns order 4512, and queries the order system. Result, say:
{"status": "shipped", "carrier": "Ground", "eta": "Thursday"}

Step 4: the app adds that result to the conversation and calls the model again.

Step 5: the model answers: "Good news, order 4512 has shipped and should arrive Thursday."

Two model calls, one tool run in between. The model chose the tool and filled in the input; the app did the work.

Why this design matters

  • Control: your code decides what actually runs, and can block or check any request first.
  • Accuracy: the answer comes from the real order system, not a guess (Day 22).
  • Security: the model never gets direct access to your database, only to the tools you choose to expose.

Where you see it at work

  • Retail: order status, returns, store stock lookups.
  • Banking: "What's my balance?" becomes a call to a balance tool, after the app confirms who you are.
  • Insurance: a claim-status assistant calls the claims system by claim number.
  • Business analysts: each tool is a small, testable requirement: inputs, outputs, errors and who may use it.

In one sentence

With tool use, the model decides which function to call and with what inputs, and your app runs it and returns the result, so answers come from real systems.

Your turn: if you could give an AI assistant one tool into a system you use at work, what would it be? 👇

Join the discussion on LinkedIn