AI AgentsAI Agent Tools & Interoperability

What is the difference between Function Calling and the Model Context Protocol (MCP)?

Question 278 of 280 · Updated

On this page

Function calling is a model-to-application mechanism for requesting that a function or tool be executed. The Model Context Protocol (MCP) is an open protocol for connecting AI applications to external tools, data, and reusable prompts through standardized client-server interactions.

They solve related but different problems. Function calling describes how a model expresses a structured request such as “look up order A-1041.” Your application receives that request, validates it, executes the function, and returns the result to the model. MCP standardizes how an AI application discovers and communicates with external capabilities, including tools, resources, and prompts.

They are not competing alternatives. An MCP client can discover tools from one or more MCP servers and expose those tools to a model using the model provider's function-calling interface. The model selects a tool; the application maps that selection to an MCP tools/call request.

In short: function calling is a model/tool interaction pattern; MCP is an interoperability protocol for tool and context providers.

1. Function calling: the basic idea#

Imagine a customer asks an AI assistant: “Where is order A-1041?”

The model has been given a tool definition:

JSON
{ "type": "function", "name": "lookup_order", "description": "Look up an order by its ID", "parameters": { "type": "object", "properties": { "order_id": { "type": "string" } }, "required": ["order_id"], "additionalProperties": false }, "strict": true }

The model can respond with a structured tool request:

JSON
{ "name": "lookup_order", "arguments": { "order_id": "A-1041" } }

Important: the model has not necessarily executed the function. It has requested that the application execute it. The application validates the arguments, checks authorization, calls the order service, and returns a result such as:

JSON
{ "order_id": "A-1041", "status": "shipped", "estimated_delivery": "2026-11-23" }

The application sends the tool result back to the model. The model can then explain the result to the user.

Function-calling control flow#

User request
    |
    v
Application sends prompt + tool schemas
    |
    v
Model chooses a function
    |
    v
Structured function call + arguments
    |
    v
Application validates and authorizes
    |
    v
Application executes function/API
    |
    v
Tool result returned to model
    |
    v
Model produces final response

The application owns execution. A function call is not proof that an action succeeded. Always inspect the actual tool result before claiming completion.

2. MCP: the basic idea#

MCP introduces a standardized client-server boundary.

  • MCP host: The AI application, such as an assistant, IDE, or agent runtime.
  • MCP client: The component inside the host that speaks the MCP protocol.
  • MCP server: A process or service that exposes capabilities such as tools, resources, and prompts.

For example, a company may run:

  • A CRM MCP server exposing customer lookup and account update tools.
  • A GitHub MCP server exposing repository and issue tools.
  • A database MCP server exposing approved query tools.
  • A documentation MCP server exposing resources and reusable prompts.

An MCP-compatible host can connect to these servers without requiring every integration to invent its own discovery and message format.

MCP architecture#

                   AI application / host
                            |
                    MCP client component
                            |
              +-------------+-------------+
              |             |             |
              v             v             v
         CRM MCP       GitHub MCP     Docs MCP
          server         server        server
              |             |             |
          CRM APIs       GitHub API    Docs store

The client initializes the connection, negotiates protocol compatibility and capabilities, discovers what the server exposes, and sends requests using MCP's message conventions. The server performs the requested operation and returns a protocol result.

MCP standardizes the integration boundary. It does not force every server to use the same internal programming language, database, business logic, or hosting platform.

3. The most important distinction: what each one standardizes#

DimensionFunction callingMCP
Main purposeLet a model request a function/tool actionStandardize client-server access to tools and context
Primary boundaryModel ↔ applicationAI host/client ↔ MCP server
Tool definitionOften provider-specific tool schema, commonly JSON SchemaMCP tool metadata and input schema
DiscoveryApplication supplies or dynamically loads tool definitionsClient requests capabilities such as tools/list
InvocationModel emits a tool call; application executes itClient sends tools/call to server
ExecutionApplication or delegated runtime executes functionMCP server handles the requested tool
TransportDepends on the model API and applicationStandardized protocol over supported transports
Other primitivesUsually function/tool callsTools, resources, prompts, and additional protocol features
InteroperabilityOften tied to a model API's tool interfaceDesigned for interoperable clients and servers
Business logicImplemented by application/functionImplemented by MCP server or downstream service

Function calling can be used without MCP. MCP can be used without a particular model provider's native function-calling API—for example, an application can invoke a discovered MCP tool directly through its client.

4. Beginner-friendly numerical example#

Suppose an AI support application needs access to 12 operations:

  • 4 CRM operations.
  • 3 order operations.
  • 3 billing operations.
  • 2 documentation operations.

Option A: direct function integrations#

The application defines and maintains 12 tool schemas and the corresponding execution adapters. If it supports three different model providers, it may need provider-specific schema conversion and tool-call handling.

A simplified integration estimate:

  • 12 tool implementations.
  • 3 model-provider adapters.
  • If every tool requires provider-specific mapping: 12 × 3 = 36 mappings.

This is an illustrative maintenance model, not a mandatory number. Good abstractions can reduce the duplication.

Option B: MCP servers plus model tool calling#

The organization exposes four MCP servers:

  • CRM server: 4 tools.
  • Order server: 3 tools.
  • Billing server: 3 tools.
  • Documentation server: 2 tools.

The host connects to the four servers, discovers their 12 tools, and makes the selected tools available to the model. The host still needs a model-specific adapter, but the integrations with the backend systems can be reused by compatible MCP clients.

The key benefit is reuse of the server-side integration, not elimination of all adapters. Every host still needs to handle tool selection, authorization, result formatting, and its own model interface.

5. How discovery and invocation differ#

Function calling#

The application commonly defines the tools in the model request. For example:

  1. Register lookup_order(order_id).
  2. Send the tool schema with the user prompt.
  3. The model chooses lookup_order.
  4. The model returns arguments.
  5. The application executes the function.
  6. The application returns the output to the model.

Some model platforms also support deferred tool loading or tool search. Therefore, it is not accurate to say function calling can never support dynamic discovery. The distinction is that the discovery mechanism is not inherently the MCP protocol.

MCP#

An MCP client connects to a server and discovers its advertised tools using tools/list. The server returns tool names, descriptions, and input schemas. The client can then request execution using tools/call.

Conceptual request:

JSON
{ "jsonrpc": "2.0", "id": 12, "method": "tools/call", "params": { "name": "lookup_order", "arguments": { "order_id": "A-1041" } } }

The server executes the operation and returns the tool result using the MCP response format. The exact message envelope and required metadata depend on the negotiated protocol version.

The distinction is important:

  • The model decides which capability it wants to use.
  • The host/client maps that decision to an MCP server and tool.
  • The MCP server executes the request.
  • The host returns the result to the model.

6. Function schemas and MCP tool schemas#

Both approaches need a clear contract between the caller and the tool.

A function-calling schema often describes:

  • Function name.
  • Description.
  • Parameters.
  • Required fields.
  • Types and constraints.
  • Strict schema behavior where supported.

An MCP tool definition similarly includes:

  • Tool name.
  • Human/model-readable description.
  • Input schema.
  • Optional output schema and annotations, depending on the specification version and implementation.

For example, both could describe an operation that accepts an order ID:

JSON
{ "name": "lookup_order", "description": "Retrieve the status of an order", "inputSchema": { "type": "object", "properties": { "order_id": { "type": "string" } }, "required": ["order_id"], "additionalProperties": false } }

Do not assume the schemas are interchangeable byte-for-byte. The host may need to translate between MCP's tool representation and the model provider's function schema. Validate the schema after conversion, especially required fields, optional values, enums, nested objects, and unsupported JSON Schema features.

7. MCP provides more than tools#

A frequent misconception is that MCP is simply another format for function calling. MCP defines several server and client primitives.

Tools#

Tools represent actions the model can request, such as searching tickets, creating a branch, or querying an approved database.

Resources#

Resources expose data or context through identifiers such as URIs. The host/application generally decides what resource content to load into the model context.

Examples:

  • A project README.
  • A customer account record.
  • A database schema description.
  • A documentation page.

Prompts#

Prompts are reusable templates exposed by a server and selected by the user or application. They can standardize recurring interactions, such as “summarize this repository” or “review this incident.”

This division of control is useful:

  • Tools are generally model-controlled.
  • Resources are generally application-controlled.
  • Prompts are generally user-controlled.

The precise interaction is determined by the host implementation and the protocol capabilities it supports.

8. Transport: how does the communication travel?#

Function calling does not prescribe a universal network transport for your application function. The model API returns a tool-call object, and your application executes the corresponding code using whatever architecture it has chosen: an in-process function, an HTTP API, a queue, or another service.

MCP standardizes message exchange and supports defined transports.

Common deployment choices include:

  • stdio: Often used when the host launches a local MCP server process, such as a desktop application or developer tool.
  • Streamable HTTP: Used for remote MCP servers accessed over HTTP. It supports web-service deployment patterns.
  • Legacy HTTP+SSE: Older MCP deployments may use this transport; check the versions supported by both client and server before choosing it.

The protocol version matters. MCP's transport and lifecycle details have evolved. The 2026-07-28 specification describes a stateless protocol core and updated HTTP behavior, while older clients and servers may still use session-oriented behavior. Do not assume all deployed MCP implementations use identical transport semantics.

9. Authentication and security boundaries#

Function calling is not an authorization system. The model's ability to request delete_customer does not mean the user is allowed to delete that customer.

Your application must validate:

  • The authenticated user's identity.
  • Whether the user may perform the operation.
  • Whether the requested record belongs to the permitted tenant.
  • Whether the arguments are valid and safe.
  • Whether the action requires explicit confirmation.
  • Whether the operation is idempotent or needs a deduplication key.

MCP does not make these checks unnecessary. It standardizes the integration protocol, but each server must enforce its own security policy.

For remote HTTP MCP servers, authorization guidance uses OAuth-based mechanisms, including bearer tokens and resource-server validation. The authorization server issues tokens; the MCP server validates them and enforces scopes. Local stdio deployments have a different security boundary and should be protected through process isolation, environment handling, filesystem permissions, and trusted configuration.

Security checklist#

  1. Apply least-privilege access to every tool and server.
  2. Scope tokens to the intended audience and operations.
  3. Validate authorization on every sensitive request, not just at connection time.
  4. Validate arguments on the server, even if the model schema is strict.
  5. Treat tool descriptions and returned content as untrusted input.
  6. Protect against prompt injection in retrieved documents and tool results.
  7. Require confirmation for high-impact actions where appropriate.
  8. Prevent cross-tenant access with server-side authorization checks.
  9. Redact secrets and sensitive fields from logs.
  10. Audit who invoked a tool, with which arguments, and what outcome occurred.

An MCP server should not expose an unrestricted database query tool merely because it is convenient. Prefer bounded, typed operations with explicit authorization and query limits.

10. Latency and cost: a worked comparison#

Assume the user asks for an order status and the model needs one tool call.

Direct function-calling architecture (illustrative):

  • Model request: 500 ms.
  • Application function and downstream API: 120 ms.
  • Model response after tool result: 450 ms.
  • Total: approximately 1,070 ms.

MCP-backed architecture (illustrative, with an already established connection and cached tool list):

  • Model request: 500 ms.
  • Host-to-MCP request and response overhead: 35 ms.
  • MCP server and downstream API: 120 ms.
  • Model response after tool result: 450 ms.
  • Total: approximately 1,105 ms.

The example adds 35 ms for the protocol hop. Actual latency varies with deployment, network distance, authentication, connection reuse, serialization, server load, and tool implementation. If the MCP server is remote and the direct function is local, the difference can be larger. If an MCP server consolidates multiple integrations or avoids duplicated setup, the operational benefit may outweigh a small per-call overhead.

Cost also depends on the model tokens used to describe available tools, the number of model calls, server hosting, and downstream API charges. MCP does not inherently reduce token usage. Tool discovery, caching, filtering, and deferred loading can reduce the number of schemas sent to a model, but the host must implement those optimizations correctly.

Track:

  • Tool discovery and refresh time.
  • Model request and response latency.
  • MCP round-trip latency.
  • Downstream service latency.
  • Input/output tokens and model cost.
  • Failed calls, retries, and timeouts.
  • Cost per successful task.

11. Reliability and error handling#

A function-calling application must distinguish:

  • A model refusing or failing to produce a tool call.
  • Invalid function arguments.
  • An application-side validation or authorization failure.
  • A downstream API error.
  • A timeout or ambiguous result.
  • A successful tool execution followed by a model response failure.

MCP introduces additional possible failure points:

  • Client/server initialization or version negotiation failure.
  • Transport disconnection.
  • Capability mismatch.
  • Tool discovery failure or stale cached definitions.
  • Unknown tool name.
  • Schema validation failure.
  • MCP server internal error.
  • Authorization failure.
  • A tool result marked as an error.

An MCP tool response may contain an error indication; clients should inspect it and must not treat every returned content block as a successful business operation. Protocol-level errors and tool-execution errors are different failure categories.

Example: a payment refund#

A model requests a refund for $50. The application calls an MCP refund tool, but the connection times out before the client receives a response.

The refund may have succeeded even though the client saw a timeout. Blindly retrying could issue a second refund.

A safe design:

  1. Give the refund operation an idempotency key.
  2. Persist the request and its workflow ID.
  3. Have the server pass the key to the payment provider.
  4. On timeout, query the transaction status before retrying.
  5. Return a verified final status to the model.
  6. Record the action in an audit log.

The same principles apply to direct function calling. MCP does not automatically provide exactly-once business execution.

12. Observability: what should you monitor?#

For direct function calling, record:

  • Request and conversation/workflow IDs.
  • Model and tool-schema versions.
  • Selected function and validated arguments.
  • Authorization decision.
  • Execution duration and downstream status.
  • Tool output or a safe reference to it.
  • Retry count, error category, and final outcome.

For MCP, additionally record:

  • MCP client and server identities and versions.
  • Negotiated protocol version and capabilities.
  • Transport type and connection lifecycle.
  • Tool-list version or cache state.
  • MCP method, tool name, and request ID.
  • Server-side execution duration.
  • Protocol error versus tool-level error.
  • Authorization scopes and decision outcome.
  • Notifications, progress, and cancellation events where used.

Use trace IDs across model calls, the host, MCP client, MCP server, and downstream APIs. Redact credentials and sensitive arguments. A successful tools/call exchange is not sufficient evidence that the business operation achieved the user's intended outcome.

13. Common misconceptions#

“MCP replaces function calling.” No. MCP standardizes server/client integration. A host can translate MCP tools into function definitions for a model.

“Function calling executes the function inside the model.” No. The model emits a structured request. The application or runtime executes it.

“MCP is just an API wrapper.” It can wrap existing APIs, but it also defines discovery, protocol messages, capability negotiation, resources, prompts, and other standardized interactions.

“Every MCP server is remote.” No. MCP can use local stdio processes as well as remote HTTP deployments.

“MCP guarantees secure tool access.” No. Authentication, authorization, validation, and safe execution remain the responsibility of the host and server.

“If a tool schema is valid, its result is trustworthy.” No. Validate returned data, check tool errors, and treat external content as untrusted.

“MCP always makes integrations faster or cheaper.” No. It may add a network hop and protocol overhead. Its value is often reuse, interoperability, and consistent capability discovery.

14. When should you choose each approach?#

Use direct function calling when:#

  • You have a small number of tools owned by one application.
  • The integration is specific to one model provider or application.
  • You want the simplest possible execution path.
  • Your application already has stable function adapters.
  • You do not need shared integrations across multiple hosts.

Use MCP when:#

  • You want the same integration to work across multiple MCP-compatible hosts.
  • Tools and context are owned by separate services or teams.
  • Runtime tool discovery and capability negotiation are valuable.
  • You need a standard way to expose tools, resources, and prompts.
  • You are building a reusable integration ecosystem.

Use both when:#

  • You want MCP for backend integration and discovery.
  • You want model-native function calling for model selection and invocation.
  • Your host can map discovered MCP tools to model tool schemas.
  • You need one consistent server implementation across several AI applications.

A common production architecture is:

User
 |
 v
AI host / agent runtime
 |
 +---- Model API (function/tool schemas)
 |              |
 |         Model tool call
 |              |
 +<-------------+
 |
 v
Host maps selected tool
 |
 v
MCP client
 |
 v
MCP server
 |
 v
Authorized business API
 |
 v
MCP result -> host -> model
 |
 v
Final answer

15. Practical implementation checklist#

Before shipping:

  • Define whether the integration is application-specific or should be reusable across hosts.
  • Decide which capabilities should be tools, resources, or prompts.
  • Publish clear tool names, descriptions, and input/output schemas.
  • Validate and authorize every operation on the server side.
  • Negotiate and test supported protocol versions and capabilities.
  • Choose stdio or Streamable HTTP based on deployment needs.
  • Implement authentication and scoped authorization for remote servers.
  • Handle tool-list changes and stale cached schemas.
  • Set request deadlines, bounded retries, and cancellation behavior.
  • Use idempotency for side-effecting operations.
  • Trace model calls, MCP messages, and downstream API operations.
  • Test malformed arguments, unavailable servers, expired credentials, duplicate requests, and partial failures.
  • Compare end-to-end latency and cost against a direct function-calling baseline.

16. Final takeaway#

Function calling tells a model how to request an action from its application. MCP standardizes how an AI application discovers and communicates with external capabilities.

If you are building one application with a few internal functions, direct function calling may be all you need. If you are building reusable integrations that should work across multiple AI hosts, MCP provides a standardized boundary. In many production systems, the strongest design uses both: MCP for interoperable integrations and function calling for the model's tool-selection loop.

Do not choose MCP merely because it is newer, or function calling merely because it is simpler. Choose based on reuse, ownership, security boundaries, operational overhead, and the integration ecosystem you actually need.

17. Failure modes to test explicitly#

Test the following failure modes in both direct function-calling and MCP-backed implementations: unavailable downstream service, invalid or incomplete arguments, expired or insufficient credentials, stale tool definitions, protocol-version or capability mismatch, transport timeout after a side effect may have occurred, duplicate invocation, oversized or malicious tool output, partial result delivery, and cancellation while work is running. Distinguish model selection errors, host/client errors, protocol errors, server execution errors, and business-operation failures. For each case, define the expected user-visible behavior, retry policy, audit event, and recovery path. Use idempotency keys and status reconciliation for writes; use bounded retries for transient read failures; refresh discovery metadata when schemas change; and fail closed when authorization cannot be established.

Related questions

Explore other topics:Large Language ModelsRetrieval-Augmented GenerationMLOps