Jenny Yang‘s Personal Blog

Back

MCP (Model Context Protocol) defines a standard way for AI agents to discover and invoke tools. Instead of hardcoding logic, the agent reads a tool definition at runtime and figures out how to call it based on the user’s intent.

The Flow#

The diagram below shows the full cycle for a simple weather query.

MCP tool call flow diagram

1. User sends a natural language query#

"What's the weather like in Shanghai today? Show me in Celsius."
plaintext

2. Agent decomposes intent and extracts parameters#

The agent matches the query against available tool descriptions:

StepResult
intent match"weather" → matches description of get_weather
city extract"Shanghai"city = "Shanghai"
unit extract"Celsius"unit = "celsius"

3. Agent reads the tool definition#

The tool definition tells the agent exactly what it needs to call the tool:

{
  "name": "get_weather",
  "description": "Get current weather and temperature for a given city",
  "parameters": {
    "city": "string - name of the city (required)",
    "unit": "string - \"celsius\" or \"fahrenheit\" (optional)"
  }
}
json

4. Agent generates and executes the tool call#

{
  "tool_name": "get_weather",
  "arguments": { "city": "Shanghai", "unit": "celsius" }
}
json

The tool runs, returns the result, and the agent formats it into a natural language response.

Why This Matters#

The agent never needs to know the implementation of get_weather. It only needs:

  • A description good enough to match intent
  • A parameter schema to know what to extract

This separation is what makes MCP tools composable — you can add new tools without changing the agent.

How MCP Tools Work
https://astro-pure.js.org/blog/mcp-skill
Author Jenny Yang
Published at March 26, 2026