Skip to content
Back to log

What’s the difference between MCP and function calling?

Chainabit's Chao · · 7 min read

In short

How do direct function calling and MCP fit into the same workflow? See how responsibilities are divided, from defining tools to passing results back to the model.

According to Anthropic’s overview of tool use, function calling lets Claude call predefined functions. Claude uses the user’s request and the tool description to decide whether to call a tool. It then returns a structured call for the application or Anthropic to execute.

The Model Context Protocol architecture overview defines MCP as a protocol for exchanging context. MCP servers can expose tools and also provide resources and prompts. An MCP client can retrieve the server’s tool list, make it available to the model, and execute a tool the model calls. A tool exposed through MCP and a tool call made by the model can be part of the same workflow.

How does direct function calling work?

In the direct approach Anthropic describes, the developer writes the schema for their tool, and the application executes the tool call. The tool definition is included in the API request. When Claude decides to make a call, it returns a tool_use block in its response. The application processes the call in that block and sends the result back to Claude as a tool_result.

In Anthropic’s weather example, the first request defines a tool called get_weather. The definition includes the name, description, and input_schema fields. Within input_schema, properties defines the inputs the tool accepts, and required specifies which inputs are mandatory. In the example, location is a required string input.

The tool_use block in Claude’s first response contains the tool name and its inputs. After running the weather lookup, the application adds the previous assistant response and the result to the conversation. The tool_use_id in the result block links the result to the corresponding tool call. After the second request, Claude uses the result to answer the user’s original question.

Anthropic distinguishes between client tools and server tools based on where they run. Developer-defined client tools run in the application. For some client tools whose schemas Anthropic defines, the application still executes the call and returns a tool_result. Server tools run on Anthropic’s infrastructure, and the application receives the result without handling execution in the usual workflow.

The term server tools has a different meaning from MCP server. Anthropic uses server tools to refer to tools that run on its own infrastructure. In MCP architecture, a server is a program that provides context to MCP clients. An MCP server can run locally or remotely.

Anthropic also describes a tool runner that handles the round trip for the developer. With this approach, the SDK executes the tools and sends the results back automatically. Developers can also include tools in a direct API call.

How are responsibilities divided in an MCP connection?

MCP architecture defines three roles: host, client, and server. The host is the AI application that manages one or more MCP clients. The client maintains a connection to an MCP server and retrieves context from it for the host to use. The server is the program that provides context to MCP clients.

According to the MCP architecture overview, the host creates a separate client for each MCP server it connects to. Each client maintains its own connection to the corresponding server. A host connected to multiple servers manages each connection through a separate client.

The protocol divides data exchange into two layers: the data layer and the transport layer. The data layer defines the structure and meaning of messages between the client and server. It covers tools, resources, prompts, and notifications. The transport layer handles communication details such as establishing connections and carrying messages.

MCP defines two transport mechanisms. The stdio transport uses standard input and output streams between local processes on the same machine. The Streamable HTTP transport uses HTTP POST for client-to-server messages and can use Server-Sent Events for streaming. Streamable HTTP supports HTTP authentication methods such as bearer tokens, API keys, and custom headers. MCP recommends OAuth for obtaining authentication tokens.

In the data layer, clients send requests to the server, and the server responds. The server can also request input from the client through Multi Round-Trip Requests. Notifications can be used when no response is needed. MCP uses the same JSON-RPC message format across transport mechanisms.

Tool definition and discovery

When using the Anthropic API directly, the developer includes the schema for their tool in the request’s tools parameter. In an MCP workflow, the client can discover the tools exposed by the server through a tools/list request. The MCP architecture overview explains that the list can be made available to the model and that a tool called by the model can be executed with tools/call.

Turn this insight into action.

Use the mobile app to continue with guided workflows.

The tools/list response contains a tools array. Each tool object’s name field identifies it within the server’s namespace. The title is a name that can be displayed to users. The description explains what the tool does and when to use it. The inputSchema defines the expected inputs using JSON Schema.

In the MCP example, the weather_current tool’s inputSchema includes location and units inputs. The location input is required. The units field accepts values specified by enum and has a default value in the example. The listing request also accepts an optional cursor parameter for pagination.

The client can send a tools/call request using the tool name from the listing response. According to the MCP architecture overview, the request’s name field exactly matches the name in the discovery response. The arguments field contains inputs that conform to the tool’s inputSchema definition. In the weather example, this field contains the location and units values.

An MCP tool response contains an array called content, and each content object has a type field. In the example, the result is text. The MCP architecture overview notes that tool results can also include image, audio, resource_link, and resource types. A tool can also return a structured JSON value in the optional structuredContent field.

In the application example in the MCP architecture overview, tool lists from connected servers are combined into a single list that the language model can access. When the model decides to use a tool, the application routes the call to the corresponding MCP server. The tool result is then passed back to the model as part of the conversation.

Change notifications and other features

When the tool list changes, an MCP server can notify connected clients. Change notifications are optional. The client opens a long-lived subscriptions/listen stream and specifies the types of notifications it wants to receive. The server’s subscription acknowledgment lists the notification types it accepted.

In the MCP example, the client uses the toolsListChanged filter to request tool list updates. The server can send a notifications/tools/list_changed notification when the list changes. The notification requires no response. After receiving it, the client can call tools/list again to retrieve the current list.

MCP servers offer three core primitives: tools, resources, and prompts. Tools are executable functions that an AI application can call to perform actions. The MCP architecture overview gives file operations, API calls, and database queries as examples.

Resources are data items that provide context to the AI application. The MCP overview gives file contents, database records, and API responses as examples. Prompts are reusable templates that help structure interactions with the language model.

Each type has a */list method for discovery. Resource content is retrieved with resources/read, and prompts are retrieved with prompts/get. Tools are executed with tools/call. A database MCP server can expose tools for running queries, provide the database schema as a resource, and offer examples of tool use in a prompt.

MCP also allows a server to ask the user for more information. This feature is called elicitation, and the server makes the request with elicitation/create. The MCP architecture overview lists requesting additional information and getting the user’s approval for an action as examples.

Workflow limitations

With Anthropic’s default tool_choice behavior, Claude decides on each turn whether to call a tool or respond directly. It may call a tool if the request matches the tool’s described capabilities and the answer is not already in the context. Anthropic notes that the tool_choice setting can be used to require a tool call.

A user’s request may not provide enough information for a tool’s required parameters. According to Anthropic, Claude may ask for the missing information or may guess a value the user did not provide. There is no guarantee which it will do in a given case.

Models vary in which MCP tool result content types they accept. According to the MCP architecture overview, the client may need to handle content the model does not support. There is also no guarantee that every change notification will be sent or received, particularly when the transport reconnects.

MCP is a protocol for exchanging context. The MCP architecture overview leaves it to the AI application to decide how to use the LLM and manage the context it receives. Anthropic’s direct tool use workflow describes the steps from Claude returning a structured call to the application sending the result back.

Ready to start?

Download the app and continue from your phone.

End of Entry