Skip to content
Glossary · AI building blocks

Tool calling (function calling)

Also called function calling, tool use.

Definition

A way for a language model to ask your application to run a defined function and give it the result.

Last updated

What it is.

You describe each tool to the model: its name, what it does and the inputs it takes, usually as a JSON schema. When the model decides a tool would help, it replies with a tool call, the tool name plus arguments, instead of plain text. Your code runs the function and sends the result back, and the model continues.

The model never runs anything itself. Your application decides whether to run each call, with what permissions, and what to send back. That is where security and business rules belong.

Why it matters

Tool calling is how an LLM gets live data and takes actions: checking stock, booking a slot, creating a ticket. It is the base layer of every AI agent. Done well, it keeps the model on facts from your systems instead of guesses, which cuts down on hallucinations.

Watch out

Common mistakes.

  1. 01

    Trusting the model's arguments. Validate every input as you would user input.

  2. 02

    Exposing too many similar tools. The model picks better from a short, clearly named list.

  3. 03

    Letting write actions run without confirmation or limits.

Tools

Work it out with a tool.

Related

Related terms.

Building something with this? Ask an engineer.

OceanLab designs and builds production software. Tell us what you are planning and we will reply with how we would approach it.

OceanLab

Enterprise Software Engineering - Human + AI

Languages

Locations

Global Headquarters

21 Merchant Road, 3rd Floor, Singapore 058267

Main corporate office and leadership operations

North America Office

548 Market Street, PMB 12472, San Francisco, CA 94104

Client operations and business development

India Office

402 Shivalik Shilp II, SG Highway, Ahmedabad 380015

Engineering and delivery center

© 2026 - Copyright. All Rights reserved OceanLab