Skip to main content
ModelTerms

Agents & Tools · beginner

Function Calling

Function calling is the specific API mechanism by which an LLM emits a structured request to invoke a named function with typed arguments. The OpenAI-popularized way to do tool use.

Explanation

You supply the model with a JSON schema describing each function (name, description, parameter types). The model decides when to call one and emits a structured payload that your code can parse and execute. The result is fed back as a tool message in the next turn.

Function calling differs from older "let the model emit JSON in plain text" patterns by being a first-class output mode: the provider guarantees valid JSON and routes the message into a distinct tool channel.

Examples

  • OpenAI's tools parameter and tool_calls response.
  • Anthropic's tool_use content blocks.

Frequently asked

What is Function Calling?

Function calling is the specific API mechanism by which an LLM emits a structured request to invoke a named function with typed arguments. The OpenAI-popularized way to do tool use.

What is an example of function calling?

OpenAI's tools parameter and tool_calls response.

How is Function Calling related to Tool Use?

Function Calling and Tool Use are both agents & tools concepts. Tool use is when an LLM can call external functions — APIs, code interpreters, databases, web fetchers — and read their results. The mechanism that turns chat into action.

Is Function Calling considered beginner?

Function Calling is generally considered beginner-level material in the AI and LLM space.

Tool UseAgents & Tools

Tool use is when an LLM can call external functions — APIs, code interpreters, databases, web fetchers — and read their results. The mechanism that turns chat into action.

AgentAgents & Tools

An AI agent is an LLM-driven system that decides which actions to take, executes them via tools, observes the results, and iterates until a goal is met.

Model Context ProtocolAgents & Tools

MCP is an open standard for connecting LLMs to external tools and data sources. It defines a JSON-RPC protocol so any client (Claude Desktop, Cursor, IDE plugins) can talk to any MCP server.

ReActAgents & Tools

ReAct is a prompting pattern that interleaves reasoning ("Thought:") with actions ("Action:") and observations ("Observation:"). It is the foundation of most tool-using agents.

System PromptPrompting

The system prompt is the first message in a chat that sets the model's persona, rules, and overall behavior. It is treated by most providers as higher-trust than user input.

Side-by-side comparisons

Sources