๐Ÿ”ฅ 0
โญ 0
Lesson 1 of 10 20 min +150 XP

What is MCP & Tool Use?

Imagine an AI assistant that can actually do things - not just talk about them. An assistant that can check your inventory levels, process a refund, calculate shipping rates, and update customer records. All in a single conversation.

That's what the Model Context Protocol (MCP) and tool use enable.

WITHOUT MCP

  • AI can only answer questions
  • No access to real-time data
  • Can't execute actions
  • Isolated from business systems
  • Limited to training data

WITH MCP

  • AI executes real actions
  • Live data from your systems
  • Processes payments & orders
  • Integrated with all APIs
  • Context-aware responses

The Evolution: From Chatbots to AI Agents

AI has evolved from simple Q&A bots to agentic systems that can take action in the real world.

2020-2022
Chatbots
Q&A only
โ†’
2023
Function Calling
Simple tools
โ†’
2024-2025
MCP Agents
Universal protocol

What is Tool Use?

Tool use (also called function calling) allows an AI model to request the execution of external functions. Instead of just generating text, the model can:
  • Recognize when a tool is needed
  • Select the appropriate tool
  • Generate the correct parameters
  • Receive the result and continue the conversation
// Example: AI decides to check inventory
const toolCall = {
  name: "check_inventory",
  arguments: {
    product_id: "SKU-12345",
    warehouse: "US-WEST"
  }
};

// Your system executes the tool and returns results
const result = await executeInventoryCheck(toolCall.arguments);
// { available: 142, reserved: 23, incoming: 500 }

// AI uses the result in its response
// "You have 142 units available in your US-WEST warehouse..."

What is MCP?

The Model Context Protocol (MCP) is an open standard created by Anthropic in November 2024. It standardizes how AI applications connect to external data sources and tools.

Think of MCP as USB-C for AI

Before USB-C, every device had different ports. MCP is the universal connector that lets any AI system talk to any tool or data source using a standardized protocol.

MCP Architecture

MCP uses a client-server architecture with JSON-RPC 2.0 for communication:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   AI Model      โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   MCP Client    โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   MCP Server    โ”‚
โ”‚  (Claude, GPT)  โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚   (Your App)    โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚ (Stripe, CRM)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ”‚ JSON-RPC 2.0
                              โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  Tools:                                     โ”‚
                    โ”‚  โ€ข create_payment    โ€ข check_inventory      โ”‚
                    โ”‚  โ€ข get_shipping_rate โ€ข lookup_customer      โ”‚
                    โ”‚  โ€ข process_refund    โ€ข update_order_status  โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

MCP Capabilities

MCP servers can expose three types of capabilities:

๐Ÿ”ง
Tools

Functions the AI can call to take actions

๐Ÿ“š
Resources

Data the AI can read (files, databases)

๐Ÿ’ฌ
Prompts

Pre-built templates for common tasks

MCP in the Real World

MCP has been adopted by all major AI providers:

Company MCP Adoption Date
Anthropic Created MCP, Claude Desktop Nov 2024
OpenAI Agents SDK, ChatGPT Desktop Mar 2025
Google Gemini models Apr 2025
Microsoft Windows 11, GitHub Copilot May 2025
Linux Foundation Agentic AI Foundation Dec 2025

E-commerce Tool Use: The Big Picture

For e-commerce applications, MCP enables AI agents to interact with your entire business stack:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     E-COMMERCE AI AGENT                         โ”‚
โ”‚                                                                 โ”‚
โ”‚  "Process a refund for order #12345 and notify the customer"   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚                       โ”‚                       โ”‚
        โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   PAYMENTS    โ”‚     โ”‚    ORDERS     โ”‚     โ”‚     CRM       โ”‚
โ”‚    (Stripe)   โ”‚     โ”‚  (Shopify)    โ”‚     โ”‚  (HubSpot)    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค     โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค     โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ process_refundโ”‚     โ”‚ get_order     โ”‚     โ”‚ get_customer  โ”‚
โ”‚ get_balance   โ”‚     โ”‚ update_status โ”‚     โ”‚ send_email    โ”‚
โ”‚ list_charges  โ”‚     โ”‚ list_items    โ”‚     โ”‚ log_activity  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Real-World Scenario

A customer messages: "I received the wrong item in my order #12345. I wanted the blue shirt, not red."

With MCP tool use, your AI agent can:

1
Lookup the order get_order(order_id: "12345")
2
Check inventory for blue shirt check_inventory(sku: "SHIRT-BLUE-M")
3
Create exchange order create_exchange(order_id: "12345", new_sku: "SHIRT-BLUE-M")
4
Generate return label create_return_label(order_id: "12345")
5
Send confirmation email send_email(customer_id: "C-789", template: "exchange_confirmation")

All of this happens in a single conversation, with the AI orchestrating multiple tools automatically.

Why MCP Matters for E-commerce

24/7 Customer Service

AI agents handle orders, returns, and inquiries around the clock without human intervention.

Reduced Integration Effort

MCP provides a standard interface - integrate once, work with any AI platform.

Real-Time Actions

Process payments, update inventory, and create shipments instantly from conversations.

What You'll Build in This Course

Throughout this course, you'll learn to build MCP tools for a complete e-commerce stack:

  • Payment Processing - Stripe integration for charges, refunds, subscriptions
  • Inventory Management - Stock lookup, reservations, low-stock alerts
  • Shipping & Fulfillment - Rate calculation, label generation, tracking
  • CRM Integration - Customer lookup, order history, communication
  • Analytics - Sales reports, revenue dashboards, trend analysis
  • Error Handling - Graceful failures, fallbacks, retry strategies

Key Takeaways

  • Tool use lets AI models call external functions to take real actions
  • MCP is the universal protocol for connecting AI to tools and data
  • E-commerce AI agents can manage orders, payments, inventory, and more
  • Industry adoption - All major AI providers now support MCP

Next up: Defining Tools with JSON Schema - Learn how to create tool definitions that AI models can understand and use correctly.

๐Ÿง  Quick Quiz

Test your understanding of this lesson.

1

What is the primary purpose of the Model Context Protocol (MCP)?

2

Which company created the Model Context Protocol?

3

In e-commerce, what can an AI agent do with MCP tool use?