Function / Tool Calling
Function / Tool Calling
Also called: 函数调用 · 工具调用 · Tool use
The model's ability to request an external function in a structured format and continue once it has the result — the basis of nearly all agent capability.
The flow of one call
- The app includes a tool manifest in the request (each tool's name, purpose, and parameter JSON Schema).
- The model does not run code; it emits structured data: "call
get_weatherwith{city: "Paris"}." - Application code actually executes that function and feeds the return value back as a new message.
- The model continues from the result — possibly calling another tool, or giving a final answer.
Why it is pivotal
It turns the model from "generates text only" into "can trigger deterministic operations and read real results." Agent loops, MCP, and retrieval augmentation are all built on this mechanism. Constraining arguments with a schema makes calls checkable, reliable, and reproducible.
Common misconceptions
- The model does not execute the function — it produces a "call intent"; execution is your runtime's job.
- Whether a tool call succeeds depends heavily on how well the tool is described — vague descriptions lead to wrong tools or wrong arguments.
Related terms
Sources
Compiled 2026-08-29 · This glossary is compiled from public papers, official specifications, and common industry definitions, and is updated as the field evolves. Corrections welcome.