Tools and Function Calling

How a Model Uses Your Systems

A model alone can only write text. Tools let it look up a record, run a calculation or create an order. This is where AI starts to do work, and where risk begins.

Ranjit Nethi

·

Tools and Function Calling

The short version

  • A tool is a function the model can ask the system to run, such as “look up order status”.
  • The model does not run anything itself. It writes a request, and your software decides whether to run it.
  • Design tools like products: clear names, narrow permissions, and safe behavior when the model gets it wrong.

The idea

Function calling, also called tool use, works in a loop. You describe the available tools to the model: each tool’s name, what it does and what inputs it needs. When the model decides a tool would help, it returns a structured request and not a final answer. Your code validates the request, runs the function and returns the result. The model then continues.

Tools fall into two groups. Read tools fetch information, such as a search or a record lookup. Write tools change something: they create an order, send an email or update a price. Write tools carry real risk and need tighter control.

Picture a new assistant who cannot touch any system. They hand you a slip that says “please look up order 5521”. You check the slip, do the lookup and hand back the result. The assistant never has the keys. You do.

  1. Model asks for a tool
  2. Software checks the request
  3. Tool runs
  4. Result returns to the model
  5. Model continues

Good tool design matters more than most teams expect. The model chooses tools by reading their descriptions, so a vague description causes wrong choices. A tool that returns 10,000 rows floods the context. An error message that says only “failed” teaches the model nothing.

An example

A customer service assistant has three tools: get order status, get tracking details and create a return request. The first two are read-only and run freely. The third changes data, so it requires an order number that belongs to the signed-in customer, it works only inside the return window, and above a set value it creates a draft for a person to approve. When a tool fails, it returns a message the model can act on, such as “order not found, ask the customer to confirm the number”.

Common mistakes

  • One broad tool, such as “run any database query”, in place of narrow ones.
  • Tool descriptions written for engineers and not for the model.
  • Giving the model the user’s full permissions, or more.
  • No limit on how many times a tool can be called.

What to do this week

  1. List the tools your assistant has. Mark each as read or write.
  2. For every write tool, write down who approves and what the limit is.
  3. Read each tool description aloud. If a new employee would be confused, so is the model.

The terms, in plain language

TermWhat it means
ToolA function the model can ask the system to run
Function callingThe model returning a structured request to run a tool
Read toolA tool that only fetches information
Write toolA tool that changes data or takes an action
Least privilegeGiving only the access the task needs

More on this topic

Shorter articles and updates filed under this section, newest first.

Section 5.2 of the AI Engineering Guide · Last reviewed November 2026

All parts of the guideChecklists and templates

About the author

Ranjit Nethi leads AI and data for commercial operations at a global industrial manufacturer. He writes about the operating model that turns AI pilots into results finance will sign. Kellogg Executive MBA; MS in Computer Science. This site is his own perspective and view, with no affiliation with any organization.