In the realm of AI engineering, three core concepts — Function Calling, Skills, and MCP — play pivotal roles in building robust and scalable AI applications. Let's break down each of them with practical insights and actionable code.
1. Function Calling: The Foundational Mechanism
Function Calling is not about AI models magically executing code on their own. Think of large language models (LLMs) as pure text engines running on GPUs — they have no inherent knowledge of your databases or APIs.
At its core, Function Calling is a structured output mechanism. Here's how it works:
- You provide the model with a
Schemathat defines your local function's structure. - The model processes natural language input, reasons about it, and outputs a JSON object that strictly adheres to the provided
Schema. - Your local code is what actually executes the action.
# Defining a Schema for a weather-checking function
weather_function_schema = {
"name": "get_weather",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string"},
"date": {"type": "string", "format": "yyyy-mm-dd"}
},
"required": ["city", "date"]
}
}
# Send the schema to the LLM and get a structured JSON response
llm_response = llm_client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "What's the weather in Tokyo tomorrow?"}],
tools=[{"type": "function", "function": weather_function_schema}]
)
# Extract and execute the function call
function_call = llm_response.choices[0].message.tool_calls[0].function
weather_data = execute_local_function(function_call.name, function_call.arguments)
Function Calling solves the problem of translating natural language intent into parameters your code can understand. It's like a single function in your codebase — fundamental but limited when used in isolation.
2. Skills: Modularizing Business Capabilities
While Function Calling is powerful, stuffing hundreds of individual function schemas into a single prompt leads to context overload, causing the model to crash or behave unpredictably. This is where Skills come in.
Skills are highly cohesive business capability modules. They package together:
- Specific prompts (e.g., DevOps guidelines).
- Multiple Function Calls.
- Even retry logic.
Consider a DevOps_Skill module:
class DevOpsSkill:
def __init__(self):
self.log_schema = self._define_log_function_schema()
self.git_schema = self._define_git_function_schema()
self.monitoring_schema = self._define_monitoring_function_schema()
self.prompt_template = "You are a DevOps assistant. Use tools: {question}"
def _define_log_function_schema(self):
return {
"name": "query_logs",
"parameters": {
"type": "object",
"properties": {"service": {"type": "string"}, "timeframe": {"type": "string"}},
"required": ["service", "timeframe"]
}
}
def execute(self, user_question):
prompt = self.prompt_template.format(question=user_question)
llm_response = llm_client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}],
tools=[{"type": "function", "function": self._get_relevant_schemas(user_question)}]
)
return self._process_llm_response(llm_response)
By encapsulating related functionalities into a Skill, you avoid context overload and make your AI application more maintainable. Skills are like classes or toolkits in your code — they abstract complexity and promote reusability.
3. MCP: The Standard Interface for AI Ecosystems
Even with Function Calling and Skills, a critical pain point remains: system-level tight coupling. A Skill built for one AI platform often can't be reused on another — moving from a Python script to Claude or Cursor requires rewriting everything.
MCP (Model Context Protocol) is the standard interface for AI. It decouples the LLM's reasoning "brain" from external tools and data:
- Your AI application acts as an MCP Client.
- Your Skills, local files, or databases are wrapped as MCP Servers.
- They communicate via a standardized protocol, enabling dynamic discovery of tools and data resources, and zero-adaptation code integration (plug-and-play).
# MCP Server: Exposing a weather service
from mcp import MCPServer, register_tool
class WeatherMCPServer(MCPServer):
@register_tool(name="get_weather", description="Get weather for a city")
def get_weather(self, city: str, date: str) -> dict:
return {"city": city, "date": date, "temperature": "25°C", "condition": "Sunny"}
server = WeatherMCPServer(host="localhost", port=8080)
server.start()
# MCP Client: Using the weather service
from mcp import MCPClient
client = MCPClient()
weather_data = client.call_tool("get_weather", {"city": "Tokyo", "date": "2026-10-31"})
print(weather_data)
MCP eliminates "integration hell" by ensuring tools and data built for one platform work seamlessly across others.
Putting It All Together: A Hierarchy of AI Engineering
- Function Calling is the microscopic action layer — translating intent to executable parameters.
- Skills are the mesoscopic module layer — packaging related capabilities for reusability.
- MCP is the macroscopic integration layer — enabling standardization and ecosystem interoperability.
To build production-ready AI applications:
- Use Function Calling to handle granular actions.
- Bundle related Function Calls and logic into Skills for maintainable business capabilities.
- Adopt MCP to ensure your Skills and tools work across platforms and scale with the AI ecosystem.
By leveraging these three concepts in tandem, you'll move beyond brittle, single-use AI scripts and build robust, scalable, and interoperable AI solutions.
FAQ
What's the difference between Function Calling and MCP?
Function Calling is a mechanism within a single LLM interaction — you define a schema, the model outputs structured JSON, and your code executes it. MCP is a broader protocol that standardizes how any AI application discovers and calls external tools across different platforms and languages. Think of Function Calling as a single API call, while MCP is the entire service architecture that makes those calls portable and interoperable. MCP often wraps Function Calling under the hood, but adds discovery, standardization, and cross-platform compatibility.
Do I need MCP if I'm just building a simple AI app?
For simple, single-purpose apps, Function Calling alone is sufficient. You only need MCP when you want your tools to be reusable across different AI platforms (Claude, Cursor, custom apps) or when building complex multi-tool systems. Start with Function Calling and Skills. When you find yourself rewriting the same tool integrations for different platforms, that's the signal to adopt MCP.
How do Skills relate to Claude Code's plugin system?
Claude Code's plugin system is essentially a Skills implementation. Each plugin packages prompts, tool schemas, and execution logic into a reusable module — exactly what Skills describe at the architectural level. The same principles apply whether you're building a Claude Code plugin, a LangChain tool, or a custom agent framework. Understanding the Skill concept helps you design better plugins regardless of the platform.