MCP vs Function Calling vs REST APIs: What Is the Difference?

A
Author
26 Oct, 2026 4 min read 0 views

MCP, function calling and REST APIs solve different layers of the same problem. Function calling is how a model asks to run a function. A REST API is how a service exposes its features over HTTP. MCP is a standard way for an AI application to discover and use tools and data from other programs. They usually work together rather than compete.

Function calling

Function calling, also called tool use, is a feature of a model provider's API. You send the model a list of tool definitions with names, descriptions and JSON Schema inputs. The model replies with a structured request such as "call get_weather with city Paris". Your code runs the function and sends the result back.

Notice what function calling does not do. It does not say where the function lives, how to discover it, how to authenticate to it or how to share it with another application. All of that is your code. The deep details of the tool-use loop are covered in the agent tool-use track of this site.

REST APIs

A REST API is an HTTP interface designed for programs written by developers. It has endpoints, verbs, status codes and often an OpenAPI description. It is not designed for a model: the endpoint names may be cryptic, responses can be huge, and one task may need five calls in a particular order. Developers read the documentation and write code to handle it. A model can only use a REST API if someone writes the glue.

MCP

MCP sits between the AI application and the capabilities it wants to use. A server describes its tools in a standard format, the client fetches the list at runtime, and the host passes those descriptions to the model using function calling. When the model asks to call one, the host forwards the request to the server over MCP.

So MCP does not replace function calling. In most hosts, MCP tools are converted into the model provider's tool format, and function calling is what carries the model's decision.

Side-by-side

QuestionFunction callingREST APIMCP
Who uses it directly?The model, via your codeDevelopers and programsAI applications
Discovery at runtimeNo, you supply definitionsOnly with a spec you parseYes, list calls
Standard message formatProvider-specificVaries per APIJSON-RPC, defined by the spec
Reuse across appsCopy the codeAny HTTP clientAny MCP client
Offers data and promptsNoOnly as endpointsResources and prompts

The same feature three ways

Say you want the model to fetch a user's profile. With a REST API there is an endpoint, perhaps GET /users/{id}. With function calling you describe a get_user function and write the code that calls that endpoint. With MCP you put that same function inside a server. The code that calls the endpoint is almost identical in both cases; what changes is where it lives and who can use it.

from mcp.server.fastmcp import FastMCP
import httpx

mcp = FastMCP("users")

@mcp.tool()
async def get_user(user_id: int) -> str:
    """Fetch a user profile as JSON text."""
    async with httpx.AsyncClient() as client:
        r = await client.get("https://api.example.com/users/" + str(user_id))
        r.raise_for_status()
        return r.text

if __name__ == "__main__":
    mcp.run()

This wraps a REST endpoint as an MCP tool. Any MCP client can now use it, with no extra glue per application.

When to choose what

  • Plain function calling is enough for one application with a handful of private tools. It has the least overhead.
  • MCP is a good fit when several applications need the same tools, when another team owns the integration, or when users bring their own servers.
  • REST only is right when no model is involved. Do not add MCP to a service just because it is popular.

Do not expose your REST API one-to-one

A common mistake is to generate one MCP tool per REST endpoint. Models handle a few well-described, task-oriented tools better than dozens of low-level ones. Later posts in this course cover how to design tools around tasks instead of endpoints.

Summary

  • Function calling is the model-side mechanism for requesting an action.
  • REST is a service-side interface for developers.
  • MCP is the connecting standard that lets AI applications discover and use capabilities from any server.
Was this article helpful?

Comments

No comments yet. Have a question or a tip? Be the first to share it.

Leave a comment

Comments are reviewed before they appear.