This skill enables interacting with Taobao through an MCP (Model Context Protocol) server to query products, manage cart/orders, and communicate with sellers.
This skill requires a running Taobao MCP server.
Default MCP Server: http://127.0.0.1:3654/mcp
If your MCP server runs on a different address, configure it via environment variable:
bash
# Add to your OpenClaw environment or shell profile
export TAOBAO_MCP_URL="http://your-server-ip:3654/mcp"
Or set it in OpenClaw config:
json
{
"env": {
"TAOBAO_MCP_URL": "http://192.168.100.20:3654/mcp"
}
}
Use this skill when the user:
NEVER perform the following operations:
Permitted operations:
When user provides a specific model (e.g., "iPhone 16 Pro Max 256GB", "MacBook Air M4 13寸 16GB+512GB", "AirPods Pro 2"):
Search with exact keywords provided by user
Filter results:
Sort by price (ascending)
Return top 5-8 results showing:
When user asks about a general category without specific model (e.g., "iPhone", "MacBook Air", "蓝牙耳机", "机械键盘"):
Search with broad keywords
Analyze all results to identify:
Categorize by specifications:
Provide comprehensive report:
Server URL: ${TAOBAO_MCP_URL:-http://127.0.0.1:3654/mcp}
Transport: streamableHttp
Server Name: taobao-native
The MCP server uses streamable HTTP transport. Standard call process:
bash
curl -X POST ${TAOBAO_MCP_URL:-http://127.0.0.1:3654/mcp} \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "openclaw-agent",
"version": "1.0.0"
}
}
}'
Extract session ID from response headers: mcp-session-id: <uuid>
Call tools with session ID in header: mcp-session-id: <session-id>
page: cart or page: orderUse when user provided specific model:
text
## 🛍️ [Product Model] 价格查询结果
### 价格对比(从低到高)
| 排名 | 店铺 | 价格 | 优惠/补贴 | 链接 |
|:---:|:---|:---:|:---|:---:|
| 1 | [店铺名] | **¥XXXX** | 政府补贴15% | [查看](URL) |
| 2 | [店铺名] | **¥XXXX** | 百亿补贴 | [查看](URL) |
| 3 | [店铺名] | **¥XXXX** | 无 | [查看](URL) |
### 购买建议
- **最优惠**: [店铺名] ¥XXXX(有政府补贴,需确认资格)
- **官方保障**: Apple Store 官方旗舰店 ¥XXXX
- **注意事项**: [任何需要提醒的事项]
Use when user asked about a category without specific model:
text
## 🛍️ [Product Category] 价格分析
查询到 [N] 款在售商品,按规格分类如下:
### 📱 规格分类与价格区间
| 规格/型号 | 价格区间 | 推荐入手价 | 说明 |
|:---------|:---:|:---:|:---|
| 入门款/基础版 | ¥X,XXX - ¥X,XXX | **¥X,XXX** | 适合日常使用 |
| 中端款/Pro版 | ¥X,XXX - ¥X,XXX | **¥X,XXX** | 性价比最高 |
| 旗舰款/Max版 | ¥X,XXX - ¥X,XXX | **¥X,XXX** | 专业需求 |
### 💰 具体价格参考
**[规格A]**
- 最低价:¥XXXX([店铺名])
- 官方价:¥XXXX(官方旗舰店)
- 百亿补贴价:¥XXXX(如适用)
**[规格B]**
- ...
### 🎯 购买建议
**预算有限**: 选择 [规格A],推荐 [店铺] ¥XXXX
**追求性价比**: 选择 [规格B],推荐 [店铺] ¥XXXX
**要官方保障**: 选择官方旗舰店 [规格] ¥XXXX
**注意事项**:
- [提醒1: 如政府补贴需要资格]
- [提醒2: 如百亿补贴库存有限]
- [提醒3: 如新品即将发布等]
Always filter out:
Link format:
https://detail.tmall.com/item.htm?id=<itemId>https://item.taobao.com/item.htm?id=<itemId>MCP service may disconnect. Detect and handle connection issues:
Connection failed indicators:
Connection failed or Connection refused errorsmcp-session-id header missing from initialize responseSession expired indicators:
-32000 with session-related messageWhen connection fails:
First failure: text
⚠️ MCP 服务连接失败,正在尝试重新连接...
Second failure (persistent): text
❌ MCP 服务暂时不可用
可能原因:
建议操作:
当前配置的 MCP 地址: ${TAOBAO_MCP_URL:-http://127.0.0.1:3654/mcp}
- Stop attempting further MCP calls
- Inform user clearly about the issue
- Provide actionable troubleshooting steps
3. **Session expired mid-operation:**
- Detect "invalid session" errors
- Automatically re-initialize with new session
- Retry the failed operation once
- If still fails, treat as connection failure (step 2)
### Proactive Health Check
Before major operations (e.g., viewing cart with many items), optionally verify connection:
bash
```bash
# Quick health check - try to get current tab
curl -X POST ${TAOBAO_MCP_URL:-http://127.0.0.1:3654/mcp} \
-H "mcp-session-id: <session-id>" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_current_tab"}}'
If the MCP server is unreachable or returns an error:
User: "iPhone 16 Pro Max 256GB 多少钱" → Specific model given → Search exact keywords → Filter accessories → Return top 5-8 prices
User: "MacBook Air 推荐" → Category only → Search broadly → Analyze all M3/M4/M5 variants → Provide price ranges for each spec → Give purchase advice
User: "看看我的购物车"
→ Use navigate to cart → read_page_content → Show items