Core Concepts

What Is Function Calling?

A capability of LLMs to generate structured function calls instead of plain text, enabling agents to interact with APIs and tools programmatically.

In Plain English

Function calling is the LLM's ability to output structured data that maps to a real function. Instead of saying "I would look up the order," the LLM outputs `lookup_order(order_id="12345")` — a real function call that can be executed.

This is the foundation of tool use. The LLM reasons about what function to call, with what parameters, and the runtime executes it. Different providers implement this differently (Anthropic's tool use, OpenAI's function calling) but the concept is the same.

In OpenClaw, function calling is abstracted through the MCP protocol. You define tools, the LLM decides when to call them, and OpenClaw handles execution.

Why It Matters for OpenClaw

Function calling turns language models from text generators into action takers. Without it, agents can only talk about doing things. With it, they actually do things.

How Clawctl Helps

Clawctl handles function calling securely. Every function call is logged. Dangerous functions require approval. Credentials needed for function execution are encrypted and injected at runtime.

Try Clawctl — 60 Second Deploy

Common Questions

Is this different from tool use?

Function calling is the LLM capability. Tool use is the broader concept of agents interacting with external systems. Function calling enables tool use.

Do all LLMs support function calling?

Most modern LLMs do — Claude, GPT-4, Gemini, and others. OpenClaw works with any LLM that supports it.

Can the agent call any function?

Only functions you configure as available tools. Clawctl adds approval gates for risky function calls.