What is function calling? Teaching LLMs to use tools
How models turn language into structured tool calls — the foundation of every agent.
Speak language, emit JSON
You register function names, parameters and docs; when the user asks for tomorrow’s weather, the model emits get_weather(city, date) as structured JSON instead of guessing. Your code runs it and the model phrases the result.
What it enables
Bookings, database queries, emails, browser control — every "AI does things" feature stands on this layer; MCP can be read as its standardized tool side. The "plugins" in Coze or Dify are function calling underneath.
中文
Function Calling 是什么?让大模型学会"调用工具"
大模型如何把自然语言变成结构化的工具调用——智能体的地基能力。
原理:说人话,出 JSON
开发者把可用函数的名称、参数、说明注册给模型;用户说"帮我查下明天北京的天气",模型不直接回答,而是输出结构化调用 get_weather(city="北京", date="明天"),程序执行后把结果交回模型组织成人话。
它撑起了什么
订票、查库、发邮件、操作浏览器——所有"AI 动手做事"都建立在这层之上;MCP 也可以理解为把 function calling 的工具端标准化。搭应用时,Coze/Dify 的"插件"底层就是它。