Tool calling, also called function calling, lets a model request that your code run a named function with structured arguments.
The model never executes anything itself. It returns a request, your code validates and runs it, and the result goes back into the conversation for the next step.
A tool is described to the model by a name, a description and a JSON Schema for its arguments. The model decides when to use it from that description alone, so the wording matters as much as the code.
Common mistake. Trusting the arguments. They come from a model that may have been misled by text it read, so validate them like input from the public internet.
In practice. Prefer narrow tools, return errors as results the model can read, cap result size, and put side effects behind approval.
An agent is a program that lets a model decide its own next steps: it calls tools, reads the results and repeats until it judges the task done or a limit stops it. Autonomy is a spectrum, and the smallest design that works, often a fixed workflow with one model call, is usually the right starting point.
Structured output means getting a model to return data in a fixed shape, usually JSON that matches a schema, instead of free prose. Some providers can constrain generation to a schema. In every case you should still validate the result in code, because a valid shape does not mean correct values.
An operation is idempotent when doing it several times has the same effect as doing it once. This matters for agents because retries are common: a timeout may hide a call that actually succeeded. An idempotency key lets the receiving system recognise a repeat and ignore it.
Cite this page
Eldan Abdrashim. "Tool calling." Eldan.ai, 23 November 2026. https://eldan.ai/glossary/tool-calling.
The date you read it is added when you copy.
BibTeX
@online{abdrashim2026tool,
author = {Eldan Abdrashim},
title = {Tool calling},
organization = {Eldan.ai},
date = {2026-11-23},
year = {2026},
month = nov,
url = {https://eldan.ai/glossary/tool-calling},
langid = {english}
}