Function Calling vs Tool Calling vs MCP函数调用、工具调用与 MCP
A layered architecture guide for AI agents — explaining execution, abstraction, and protocol systems, and how QVeris connects them through capability routing.AI Agent 分层架构指南 — 解释执行层、抽象层和协议系统,以及 QVeris 如何通过能力路由将它们连接起来。
Execution · Abstraction · Protocol · Routing执行 · 抽象 · 协议 · 路由
What is Function Calling?什么是函数调用?
Function Calling is a model-level execution mechanism where the LLM outputs structured JSON arguments instead of natural language text. It answers: "What function should I call and with what parameters?" — defining how the model communicates its intent to invoke a specific function.函数调用是一种模型级执行机制:LLM 输出结构化 JSON 参数,而不是自然语言文本。它回答“应调用哪个函数,以及使用什么参数?”,定义模型如何表达调用特定函数的意图。
Function calling is provided directly by the model API. OpenAI, Anthropic, and Google all implement it — the model receives a list of available function definitions and can respond with a structured JSON object naming the function and providing parsed arguments. The model does not execute the function. It outputs which function to call and what parameters to use. The developer's code is responsible for actually running the function.函数调用由模型 API 直接提供。OpenAI、Anthropic 和 Google 都实现了它 — 模型接收可用函数定义列表,并可以用命名函数和提供解析参数的结构化 JSON 对象响应。模型不执行函数。它输出要调用哪个函数以及使用什么参数。开发者的代码负责实际运行该函数。
Scope: Single call. The model decides to call get_stock_price(symbol="AAPL") and outputs {"name":"get_stock_price","arguments":{"symbol":"AAPL"}}. That is function calling. It does not select between multiple stock price APIs, manage API keys, handle retries, or validate schemas — those are higher-layer concerns.<strong>范围:</strong>单次调用。模型决定调用 <code>get_stock_price(symbol="AAPL")</code> 并输出 <code>{"name":"get_stock_price","arguments":{"symbol":"AAPL"}}</code>。这就是函数调用。它不在多个股票价格 API 之间选择、不管理 API 密钥、不处理重试、不验证 Schema — 这些是更高层的关注点。
What is Tool Calling?什么是工具调用?
Tool Calling is an agent-level abstraction layer that handles tool selection, tool invocation, multi-tool coordination, and execution flow. It answers: "Which tool should the agent use for this task?" — operating one layer above function calling.工具调用是 Agent 级抽象层,负责工具选择、调用、多工具协同和执行流程。它回答“Agent 应为这个任务使用哪个工具?”,位于函数调用之上。
Tool calling sits between the LLM and the actual tool implementation. When an agent has access to 10 different market data tools, tool calling determines which one to invoke — not just the function name and parameters, but which provider, which API, and which execution path. It manages the lifecycle: select → execute → validate → retry → fallback.工具调用位于 LLM 和实际工具实现之间。当 Agent 可以访问 10 个不同的市场数据工具时,工具调用决定调用哪一个 — 不仅仅是函数名称和参数,还包括哪个提供商、哪个 API 和哪个执行路径。它管理生命周期:选择 → 执行 → 验证 → 重试 → 回退。
Scope: Multi-tool. Tool calling orchestrates across multiple tools, providers, and execution attempts. It is the layer that prevents an agent from calling the wrong tool just because its name sounds right.<strong>范围:</strong>多工具。工具调用跨多个工具、提供商和执行尝试进行协调。它是防止 Agent 仅仅因为名称听起来正确就调用错误工具的层。
What is MCP?什么是 MCP?
MCP (Model Context Protocol) is a standardized tool protocol layer. It defines how tools are described, exposed, and connected to AI models and agents — tool schema format, server definition, capability metadata, and execution interface. It answers: "How are tools exposed to AI agents?"MCP(模型上下文协议)是标准化工具协议层,定义工具如何描述、暴露并连接到 AI 模型和 Agent,包括工具 Schema 格式、服务器定义、能力元数据和执行接口。它回答“工具如何暴露给 AI Agent?”
MCP, created by Anthropic, provides a common specification for MCP servers to declare their available tools, resources, and prompts. An MCP server publishes a manifest that any MCP-compatible client can read. This standardization makes tool connectivity predictable — instead of every tool having a custom integration format, MCP-compliant tools share a common language.MCP 由 Anthropic 创建,为 MCP 服务器提供通用规范来声明其可用工具、资源和提示。MCP 服务器发布任何 MCP 兼容客户端都可以读取的清单。这种标准化使工具连接具有可预测性 — 每个工具不再有自定义集成格式,MCP 兼容的工具共享一种通用语言。
Scope: Ecosystem. MCP standardizes tool exposure across the industry. It does not select which tool to use, manage retries, or route across providers. MCP makes tools easier to connect. Higher layers make them easier to select and execute reliably.<strong>范围:</strong>生态系统。MCP 标准化了整个行业的工具暴露。它不选择使用哪个工具、不管理重试、不跨提供商路由。MCP 使工具更容易连接。更高的层使它们更容易选择和可靠执行。
Layered Architecture Model分层架构模型
Layer 1 Function Calling — Execution第 1 层 函数调用 — 执行
The model outputs structured JSON naming a function and its parameters. Answers: "What function should I call and with what arguments?" Operates at the model level. Provided by OpenAI, Anthropic, Google.模型输出结构化 JSON,指定函数名称及参数。它回答“应调用哪个函数、使用哪些参数?”,运行在模型层,由 OpenAI、Anthropic 和 Google 等提供。
Layer 2 Tool Calling — Abstraction第 2 层 工具调用 — 抽象
The agent layer handles tool selection, invocation, multi-tool coordination, retries, and execution flow. Answers: "Which tool should the agent use for this task?" Operates at the agent level.Agent 层负责工具选择、调用、多工具协同、重试和执行流程。它回答“Agent 应为这个任务使用哪个工具?”,运行在 Agent 层。
Layer 3 MCP — Protocol第 3 层 MCP — 协议
A standardized specification for how tools are described, exposed, and connected. Answers: "How are tools exposed to AI agents?" Operates at the ecosystem level. Created by Anthropic.这是一套规范工具如何描述、暴露和连接的标准。它回答“工具如何暴露给 AI Agent?”,运行在生态层,由 Anthropic 创建。
Layer 4 QVeris — Routing第 4 层 QVeris — 路由
A capability routing layer that helps agents discover tools by task intent, inspect schemas before calling, and route across multiple providers. Answers: "Which capability is best for this task?" Operates across the stack.能力路由层帮助 Agent 按任务意图发现工具、调用前检查 Schema,并在多家提供商之间路由。它回答“哪项能力最适合这个任务?”,横跨整个技术栈。
Key Differences Table关键差异表
| Concept | Level | Purpose用途 | Key Question | Scope |
|---|---|---|---|---|
| Function Calling | Model模型 | Structured execution format结构化执行格式 | How does the model call a function?模型如何调用函数? | Single call |
| Tool Calling | AgentAgent | Tool selection & execution | Which tool should the agent use?Agent 应使用哪个工具? | Multi-tool |
| MCP | Protocol协议 | Tool standardization工具标准化 | How are tools exposed? | Ecosystem |
| QVeris RoutingQVeris 路由 | Routing | Capability selection across providers跨提供商选择能力 | Which capability is best?哪项能力最合适? | Cross-tool intelligence跨工具智能 |


Why All Layers Are Needed为什么需要所有层
AI agents fail when layers are collapsed into one. Each layer solves a distinct problem that the layer below cannot address:当层次被压缩为单一层时,AI Agent 会失败。每一层解决其下层无法解决的独特问题:
Function Calling Alone仅使用函数调用
Cannot choose between tools. The model can output get_price("AAPL") but cannot decide which of 10 price APIs to use, which has the right schema, or which is currently available.无法在工具之间进行选择。模型可以输出 get_price("AAPL"),但无法判断应使用 10 个价格 API 中的哪一个、哪个具有正确的 Schema,或哪个当前可用。
Tool Calling Alone仅使用工具调用
Without MCP, every tool has a custom integration format. Without a routing layer, tool selection is hardcoded and brittle — change one provider and the agent breaks.没有 MCP 时,每个工具都采用自定义集成格式;没有路由层时,工具选择被硬编码且非常脆弱,只要更换一家提供商,Agent 就可能失效。
MCP Alone仅使用 MCP
Standardizes connectivity but does not select tools, manage retries, handle fallback, or route by task intent. MCP answers "what tools exist?" — not "which tool should I use?"MCP 标准化连接方式,但不负责选择工具、管理重试、处理回退或按任务意图路由。它回答“有哪些工具?”,而不是“我应该使用哪个工具?”
No Routing Layer没有路由层
Without QVeris or equivalent routing, agents hardcode provider dependencies. When a provider changes its API, introduces rate limiting, or goes down, the agent has no recovery path.没有 QVeris 或同类路由层时,Agent 会硬编码对提供商的依赖。提供商更改 API、实施速率限制或宕机时,Agent 就没有恢复路径。
Execution Flow in Real AI Systems真实系统中的执行流程
MCP vs Tool Calling in PracticeMCP vs 工具调用实践
| Dimension | MCP | Tool Calling | Function Calling |
|---|---|---|---|
| Defines定义内容 | Tool exposure format工具暴露格式 | Tool execution logic工具执行逻辑 | Model output format |
| Answers回答的问题 | How are tools described? | Which tool to use? | How to invoke a function? |
| Operates at运行层级 | Protocol/ecosystem level协议/生态层 | Agent levelAgent 层 | Model level模型层 |
| Standardized by | Anthropic MCP specAnthropic MCP 规范 | Agent frameworkAgent 框架 | Model API (OpenAI, Anthropic, Google)模型 API(OpenAI、Anthropic、Google) |
| Handles selection? | No | Yes | No |
| Handles fallback? | No | Yes (with routing) | No |
Common Misconceptions常见误解
✔ Reality: MCP standardizes tool exposure. Tool routing (function calling + tool calling + QVeris) handles selection, execution, and fallback. Different layers.❌ 误解:MCP = 工具路由
✔ 事实:MCP 标准化工具暴露;工具路由(函数调用 + 工具调用 + QVeris)负责选择、执行和回退。它们属于不同层级。
✔ Reality: Function calling outputs which function to invoke with what parameters. It does not select between 10 different providers offering the same capability. That is tool calling and routing.❌ 误解:函数调用 = 工具选择
✔ 事实:函数调用输出要调用的函数及其参数,但不会在提供同一能力的 10 家不同提供商之间进行选择;那属于工具调用和路由。
✔ Reality: Tool calling is execution logic. MCP is a protocol specification. Execution and standardization are separate concerns.❌ 误解:工具调用 = 协议
✔ 事实:工具调用是执行逻辑,MCP 是协议规范;执行与标准化是两类不同的问题。
✔ Reality: Production AI agents need all four layers. Collapsing layers creates fragile systems that work in demos but fail under real conditions.❌ 误解:一个层级可以替代其他层级
✔ 事实:生产级 AI Agent 需要全部四层。压缩层级会产生只能在演示中运行、却在真实条件下失效的脆弱系统。
QVeris Capability Routing LayerQVeris 能力路由层
QVeris operates as a capability routing layer above MCP and tool calling systems. It does not replace function calling, tool calling, or MCP — it provides the routing intelligence that connects them into a production-grade agent architecture.QVeris 作为能力路由层运行在 MCP 和工具调用系统之上。它不替代函数调用、工具调用或 MCP — 它提供将它们连接成生产级 Agent 架构的路由智能。
Discover
Find relevant tools across MCP servers, external APIs, and capability catalogs — by task intent, not by hardcoded tool name.根据任务意图在 MCP 服务器、外部 API 和能力目录中查找相关工具,而不是依赖硬编码工具名称。
Inspect
Validate schemas, check auth, review cost and latency, read provider notes — before calling. Catch mismatches early.调用前验证 Schema、检查认证、评估成本与延迟并阅读提供商说明,尽早发现不匹配。
Call & Route
Execute selected tool safely. On failure, route to ranked fallback. Never return "I couldn't complete the task" while fallbacks remain.安全执行选定工具;失败时路由到已排序的回退方案。只要仍有回退工具,就不应直接回复“无法完成任务”。
Validate & Report
Check output structure, timestamps, source metadata. Return structured result with full traceability across all four layers.检查输出结构、时间戳和来源元数据,并返回在四个层级中都具备完整可追踪性的结构化结果。
QVeris is a capability routing layer. It does not replace function calling, tool calling, or MCP. It provides the routing intelligence on top — helping agents discover, inspect, and route across tools and MCP systems. Read the docs → or view pricing →.QVeris 是能力路由层。它不替代函数调用、工具调用或 MCP。它在其上提供路由智能 — 帮助 Agent 发现、检查和跨工具及 MCP 系统路由。阅读文档 → 或 查看定价 →。
Production Architecture Pattern生产架构模式
Getting Started Checklist快速上手指南
Build Production AI Agent Systems with Clear Architecture用清晰的架构构建生产级 AI Agent 系统
QVeris provides the capability routing layer that connects function calling, tool calling, and MCP into a production-grade agent architecture. Discover and Inspect are free forever.QVeris 提供连接函数调用、工具调用和 MCP 的能力路由层,形成生产级 Agent 架构。Discover 和 Inspect 永久免费。
Build AI Agent Systems →构建 AI Agent 系统 →Explore QVeris Docs