Definition

What is function calling?

Last updated

Definition

Function calling (also called tool use) is a feature in modern LLMs that lets the model output a structured request to invoke a function — the host application runs the function, returns the result, and the model continues reasoning with that result.

Function calling turns LLMs from text generators into agents that can act. The model is given a list of available functions with their schemas; when the model decides one would help, it emits a JSON object naming the function and arguments. The host app (your code, Claude Desktop, an MCP client) executes the function, feeds the output back, and the model continues. This is the underlying primitive behind tool-using agents, MCP servers, and most agentic workflows.

Function calling vs MCP

Function calling is the LLM-side primitive: the model can request a function call. MCP is the protocol layer: a standard for discovering, exposing, and invoking tools across clients. An MCP server registers its tools; an MCP client (Claude Desktop, your agent) surfaces them to the model via function calling.

The two compose. Most production agents use function calling for in-process tools and MCP for cross-process or third-party integrations.

Reliability patterns

LLM-emitted JSON isn’t always valid. Production agents typically: validate the call against the schema, retry with feedback on parse failures, log every call for replay, and gate side-effecting calls behind HITL approval. Glitch Grow’s production agents ship these patterns as part of their reference implementations.

Related terms

Related agents

Sources

Free Vibe Coder Kit

Get the kit. Ship like a vibe coder.

Installs into Claude Code, Codex, or OpenClaws in under a minute. Required to deploy our paid agents.

Protected by Cloudflare Turnstile. We never share your details. Unsubscribe any time.