Function calling lets LLMs invoke external functions or APIs based on conversation context. Instead of just generating text, the model can decide to call a weather API, search a database, or execute code — then use the results to formulate its response.

Learn ChatGPT & LLMs from these channels

  1. Intellipaat 13.4M subscribers · 7 videos on ChatGPT & LLMs in our index
  2. freeCodeCamp.org 12M subscribers · 10 videos on ChatGPT & LLMs in our index
  3. CodeWithHarry 10M subscribers · 3 videos on ChatGPT & LLMs in our index
  4. Simplilearn 6.8M subscribers · 53 videos on ChatGPT & LLMs in our index
  5. NetworkChuck 5.5M subscribers · 5 videos on ChatGPT & LLMs in our index

See all ChatGPT & LLMs channels →

How Function Calling Works

You define available functions with names, descriptions, and parameter schemas. When the user asks 'What's the weather in Tokyo?', the model returns a structured function call: {name: 'get_weather', arguments: {city: 'Tokyo'}}. Your code executes the function and feeds the result back to the model.

Key Concepts

  • Tool Schema — JSON schema defining available functions — name, description, and typed parameters
  • Tool Choice — Whether the model must call a tool, can choose to, or should never call one — configurable per request
  • Parallel Tool Calls — Some models can invoke multiple functions simultaneously for efficiency

Learn Function Calling — Top Videos

Frequently Asked Questions

Is function calling the same as MCP?

Function calling is the LLM capability. MCP is a protocol for organizing and serving tools to AI clients. MCP uses function calling under the hood, but adds discovery, authentication, and standardization.

Which LLMs support function calling?

GPT-4o, Claude 3+, Gemini, and most major LLMs support function calling. The exact implementation and reliability varies by model.