# Function calling (tool use)

**Source:** https://promtable.com/glossary/function-calling

> Function calling lets a language model emit a structured request to invoke a developer-defined tool, enabling reliable JSON output and agent workflows.

---
Function calling lets a language model emit a structured request to invoke a developer-defined tool, enabling reliable JSON output and agent workflows.

Function calling (sometimes called tool use) is the API feature where you give the model a JSON schema describing one or more tools, and the model responds with a tool name + arguments instead of free text. OpenAI, Anthropic, Google, and Mistral all support it. It is the foundation of every modern agent loop: the model decides which tool to call, your code runs it, the result is fed back, and the loop continues until the model emits a final answer. Done well, it replaces brittle string parsing and unlocks reliable structured output even when JSON-mode alone fails.

## When to use

- Any agent or workflow where the model needs to take external action (search, fetch, write to DB).
- Reliable structured output (more robust than "return JSON" prompting).
- Multi-step planning with tool routing.

## Common mistakes

- Defining too many tools — models above ~30 tools start mis-routing.
- Vague descriptions in the schema — the model uses them as docstrings.
- Not validating the tool arguments against the schema on the server side.

## Related terms

- [agent](https://promtable.com/glossary/agent)
- [json-mode](https://promtable.com/glossary/json-mode)
- [structured-output](https://promtable.com/glossary/structured-output)
- [system-prompt](https://promtable.com/glossary/system-prompt)

*Last updated: 2026-06-01*
---

Original page: https://promtable.com/glossary/function-calling
Maintained by Promtable (https://promtable.com). Content: CC BY 4.0. Cite as "Promtable — https://promtable.com/glossary/function-calling".
Contact: info@vibecodingturkey.com.