Artificial Intelligence 20 min read

Evolution of AI Interaction Paradigms: From Function Calling to MCP and AI Agents

The article examines the rapid rise of AI agents like Manus and OpenManus, explains the limitations of cloud‑only models, details the Function Calling mechanism and its pros and cons, introduces the Model Context Protocol (MCP) as a more powerful evolution, and finally describes how AI Agents combine planning, dynamic tool use, memory, and autonomous decision‑making to achieve fully closed‑loop intelligent automation.

Architecture and Beyond
Architecture and Beyond
Architecture and Beyond
Evolution of AI Interaction Paradigms: From Function Calling to MCP and AI Agents

Recent hype around Manus and its open‑source counterpart OpenManus highlights a growing user interest in AI agents that go beyond simple cloud‑based large language models such as ChatGPT or Claude. The article first points out three major drawbacks of cloud‑only AI: privacy concerns, latency, and limited personalization.

It then introduces the three‑stage evolution of AI interaction paradigms: Function Calling → Model Context Protocol (MCP) → AI Agent . Function Calling allows an LLM to invoke predefined APIs (e.g., OpenAI GPTs, Anthropic Claude Tool Use, Alibaba Qwen plugins) during a conversation, turning the model from a pure question‑answerer into an active tool executor.

1. Function Calling

Function Calling works by defining callable functions, letting the model decide when to call them, generating a JSON request, sending it to an external service, and finally parsing the result for the user. The basic workflow consists of:

Define callable functions (name, description, parameters).

Model detects when a function is needed.

Model generates a structured JSON call.

External API executes the task and returns a result.

Model incorporates the result and replies.

Advantages include low development cost, strong controllability, and suitability for single‑step tasks such as weather queries. Limitations are lack of context memory, inability to handle multi‑step or reasoning‑heavy tasks, and incompatibility across different AI platforms.

Claude Tool Use Example

Claude’s tool‑use API is demonstrated with a weather‑lookup tool named get_weather :

{
  "tools": [{
    "name": "get_weather",
    "description": "获取指定城市的当前天气",
    "input_schema": {
      "type": "object",
      "properties": {
        "location": {"type": "string", "description": "城市名称,例如 '北京' 或 'San Francisco'"},
        "unit": {"type": "string", "enum": ["celsius", "fahrenheit"], "description": "温度单位"}
      },
      "required": ["location"]
    }
  }]
}

A user request "旧金山现在的天气如何?" triggers a tool_use event, Claude waits for the external service to return a result such as "当前温度为 15°C,晴朗。" , and then replies to the user.

2. Model Context Protocol (MCP)

MCP, released by Anthropic in November 2024, standardises how LLMs interact with external APIs and data sources, adding robust context management and multi‑API orchestration capabilities. It consists of five components:

MCP Host : the application running the AI model (e.g., Claude Desktop, Cursor).

MCP Client : manages communication with the MCP server.

MCP Server : exposes tools, data sources, and APIs for the AI to call.

Local Data Sources : files, databases, etc.

Remote Services : external APIs such as GitHub, Slack, AWS.

Compared with Function Calling, MCP supports multi‑round interactions, task orchestration, and a generic protocol that can be reused across different AI platforms.

Why MCP is Stronger

Key differences include:

Calling method: MCP uses a standard protocol instead of direct API calls.

Context management: MCP retains conversation state across multiple calls.

Applicability: MCP handles complex, multi‑step workflows (e.g., DevOps automation).

Extensibility: One protocol can be reused for many services, avoiding per‑API custom code.

3. AI Agent – The Fully Closed‑Loop Intelligent Entity

An AI Agent represents the ultimate AI interaction paradigm. It not only calls APIs but also autonomously plans, executes, and optimises tasks, maintaining long‑term memory and adapting to user preferences.

Core capabilities:

Task decomposition & planning : The agent analyses a user request, breaks it into ordered steps, and creates a structured plan (e.g., using a planning tool).

Dynamic API selection & failure recovery : It chooses the best API at runtime and retries or switches to alternatives when a call fails.

Memory & long‑term learning : A Memory class stores recent messages (up to a configurable limit) and enables the agent to recall user preferences across sessions.

Autonomous decision‑making & feedback loops : The agent continuously thinks, acts, checks for loops, and iterates until the task is finished.

OpenManus implements these abilities with modules such as PlanningAgent , tool‑call handling with error tracking, and a memory subsystem that trims older messages.

Sample Code Snippets

Dynamic tool execution with error handling:

async def act(self) -> str:
    try:
        result = await self.execute_tool(command)
        self.step_execution_tracker[tool_call_id]["status"] = "completed"
    except Exception as e:
        logger.warning(f"Failed to execute tool: {e}")
        self.step_execution_tracker[tool_call_id]["status"] = "failed"

Memory management:

class Memory(BaseModel):
    messages: List[Message] = Field(default_factory=list)
    max_messages: int = Field(default=100)

    def add_message(self, message: Message) -> None:
        self.messages.append(message)
        if len(self.messages) > self.max_messages:
            self.messages = self.messages[-self.max_messages:]

    def get_recent_messages(self, n: int) -> List[Message]:
        return self.messages[-n:]

Agent decision loop:

async def step(self) -> str:
    should_continue = await self.think()
    if not should_continue:
        self.state = AgentState.FINISHED
        return "Task completed"
    result = await self.act()
    if self.is_stuck():
        self.handle_stuck_state()

Applications

AI Agents can be deployed as intelligent office assistants, automated DevOps operators, financial advisors, or personalized home assistants, shifting human‑AI interaction from passive query answering to proactive task execution.

Evolution Summary

The progression from Function Calling (single‑step tool use) to MCP (context‑aware multi‑API orchestration) and finally to AI Agents (autonomous planning, memory, and decision‑making) marks a fundamental shift in how AI systems will assist and automate real‑world workflows.

MCPOpenManusAI Agentfunction callingModel Context ProtocolAI AutomationAI Interaction
Architecture and Beyond
Written by

Architecture and Beyond

Focused on AIGC SaaS technical architecture and tech team management, sharing insights on architecture, development efficiency, team leadership, startup technology choices, large‑scale website design, and high‑performance, highly‑available, scalable solutions.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.