Skill: fireium/eshop (version 1.1.0)

--- name: eShop description: 一个聚合购物与外卖服务的智能平台，帮助用户完成商品搜索、下单购买、外卖点餐、订单查询、优惠券领取等全流程购物体验。支持多平台、多商家、多品牌的统一接入与智能路由。 version: 1.0.4 author: xavizhou metadata: {"openclaw": {"emoji": "🛒", "category":[ "shopping","delivery","e-commerce"], "tags": ["电商", "外卖", "聚合", "商品搜索", "购物助手", "餐饮点单"]}} --- # eShop ## 概述 `eShop` 是电商和外卖的工具库，用于帮助用户购物或者点外卖。 顶层 `skill.md` 只负责： - 识别用户意图 - 判断任务域 - 识别平台、商家、品牌等实体 - 将请求路由到对应子文档 - 在必要时才加载详细说明 --- ## 任务域 ### 外卖 适用于以下请求： - 我要点餐 - 我要点外卖 - 帮我点麦当劳 - 看看有什么吃的 对应子目录： ```text delivery/ ``` ### 电商 适用于以下请求： - 我要买东西 - 帮我找商品 - 看看某个平台上的商品 - 我想买手机壳 对应子目录： ```text ecommerce/ ``` --- ## 路由原则 处理流程： ```text 用户输入 -> 意图识别 -> 任务域判断 -> 实体抽取 -> 别名归一化 -> 文件映射 -> 按需加载子文档 ``` 规则： 1. 先判断是外卖还是电商 2. 再识别用户是否指定了平台、商家、品牌或店铺 3. 只有在目标明确平台，商家，品牌信息的时候，才加载对应子文档 4. 不要一次性加载所有子文档 5. 若信息不足，先澄清，再决定是否加载 --- ## 实体映射 当用户提到已知平台、商家或品牌时，先做别名归一化，再映射到文件路径。 示例： - 麦当劳 / McDonald's / mcd -> `delivery/merchants/mcd.md` - 肯德基 / KFC -> `delivery/merchants/kfc.md` - 必胜客 / Pizza Hut -> `delivery/merchants/pizzahut.md` - 骆岗/ Luogang / inLG -> `ecommerce/platforms/luogang.md` - 平台1 -> `delivery/platforms/platform1.md` 匹配优先级： 1. 精确别名 2. 常见缩写 3. 标准名称 4. 若有多个候选，先澄清 5. 若没有命中，留在顶层通用流程 --- ## Routing Index ### 外卖商家 - aliases: `麦当劳`, `McDonald's`, `McDonald`, `mcd`, `mcdonalds` target: `delivery/merchants/mcd.md` <!-- - aliases: `肯德基`, `KFC`, `kfc` target: `delivery/kfc.md` - aliases: `必胜客`, `Pizza Hut`, `pizzahut` target: `delivery/pizzahut.md` ### 外卖平台 - aliases: `平台1`, `外卖平台1` target: `delivery/platform1.md` - aliases: `平台2`, `外卖平台2` target: `delivery/platform2.md` - aliases: `平台3`, `外卖平台3` target: `delivery/platform3.md` --> ### 电商平台 - aliases: `luogang`,`Luogang`,`inLG`,`骆岗`, `骆岗电商`, `骆岗门市部` target: `ecommerce/platforms/luogang.md` --- ## 澄清策略 以下情况先澄清，不直接加载子文档： - 未说明是外卖还是电商 - 未指定平台或者品牌，但后续必须依赖平台规则 - 实体可能对应多个目标 示例提问： - 你是想点外卖，还是买商品？ - 你有指定平台吗？ --- ## 示例 ### 我要点麦当劳 处理： ```text 外卖 -> 实体: 麦当劳 -> 归一化: mcd -> 加载: delivery/mcd.md ``` ### 我想买手机壳 处理： ```text 电商 -> 未指定平台，默认使用 luogang -> 再决定是否加载子文档 ``` ### 去骆岗看看耳机 处理： ```text 电商 -> 实体: luogang -> 加载: ecommerce/luogang.md ```

path: _meta.json
content: {
  "name": "eShop",
  "description": "一个聚合购物与外卖服务的智能平台，帮助用户完成商品搜索、下单购买、外卖点餐、订单查询、优惠券领取等全流程购物体验。支持多平台、多商家、多品牌的统一接入与智能路由。",
  "version": "1.0.4",
  "envs": [
    {
      "name": "SHOPPING_MCP_URL",
      "description": "电商聚合 MCP 服务地址",
      "required": true,
      "default": "https://yuju-mcp.wxhoutai.com/mcp"
    },
    {
      "name": "DEFAULT_PLATFORM_ID",
      "description": "默认使用的电商平台标识（如 luogang, taobao 等）",
      "required": false,
      "default": "luogang"
    }
  ]
}


path: delivery/merchants/kfc.md
content: # KFC Delivery Guide

TODO: Add KFC delivery instructions


path: delivery/merchants/pizzahut.md
content: # Pizza Hut Delivery Guide

TODO: Add Pizza Hut delivery instructions


path: delivery/merchants/mcd.md
content: ---
name: mcdonald-order
description: McDonald's China assistant (麦当劳助手) for coupon management, delivery ordering, and nutrition planning. Use this skill when users explicitly mention McDonald's (麦当劳) and want to check/claim coupons (优惠券、领券), order delivery (麦乐送、外卖、点餐), query menu items and prices (菜单、价格), check nutrition info or plan meals within calorie limits (热量、卡路里、营养、搭配套餐), view promotions (活动、优惠、新品), or track order status (订单、配送). Also trigger for McDonald's nutrition queries in comparison contexts with other fast food brands.
---

# McDonald's Assistant (麦当劳助手)

## Prerequisites

**Required Tools**: `execute_bash`

**Required Environment Variables**:
- `MCD_TOKEN` (required) - API authentication token from https://mcp.mcd.cn
- `MCD_MCP_URL` (optional) - MCP service endpoint URL (default: https://mcp.mcd.cn)

**Security Notes**:
- MCD_TOKEN contains API credentials - never log or expose in output
- Always require user confirmation before creating orders or claiming coupons
- Price calculations must be confirmed by user before order creation

Help users interact with McDonald's China services through MCP API calls. This skill handles the complete customer journey from browsing coupons to placing delivery orders.

## Core Capabilities

1. **Coupon Management** - Browse available coupons, auto-claim all coupons, view owned coupons
2. **Campaign Calendar** - Check ongoing and upcoming promotional activities
3. **Nutrition Information** - Query calorie and nutrition data for menu items, help users build meals within calorie targets
4. **Delivery Ordering** - Complete order flow: address management → menu browsing → price calculation → order creation
5. **Order Tracking** - Check order status and delivery progress

## Prerequisites

**Required**: `MCD_TOKEN` environment variable must be set. Users obtain this from https://mcp.mcd.cn

If the token is missing or API returns authentication errors:
1. Inform the user they need to set `MCD_TOKEN`
2. Provide the registration URL: https://mcp.mcd.cn
3. Show how to set it: `export MCD_TOKEN="your_token_here"`

## API Call Pattern

All tools are invoked via curl to the MCP endpoint:

```bash
curl -s -X POST "${MCD_MCP_URL:-https://mcp.mcd.cn}" \
  -H "Authorization: Bearer ${MCD_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"TOOL_NAME","arguments":{...}},"id":1}'
```

Parse responses from `result.content[0].text` or `result.structuredContent`.

**Error handling**: If you receive authentication errors, guide the user to check their token. For rate limiting, suggest waiting before retrying.

## Workflow Patterns

### Pattern 1: Coupon Discovery & Claiming

**Trigger phrases**: "有什么优惠券", "帮我领券", "麦当劳优惠"

**Flow**:
1. Call `available-coupons` to show what's claimable
2. If user wants to claim, call `auto-bind-coupons`
3. Optionally call `query-my-coupons` to confirm

**Output format**: Present as a numbered list with:
- Coupon name and discount amount
- Validity period
- Usage conditions (if any)

### Pattern 2: Delivery Order (Critical Path)

**Trigger phrases**: "我要点外卖", "麦乐送", "点麦当劳"

**Flow** (must follow this sequence):

1. **Get delivery address** - Call `delivery-query-addresses`
   - Returns: `addressId`, `storeCode`, `beCode` (required for all subsequent calls)
   - If empty: Guide user to create address with `delivery-create-address`
   - If multiple: Ask user to choose

2. **Browse menu** - Call `query-meals` with `storeCode` and `beCode`
   - Show menu items with names, prices, and `productCode`
   - User selects items

3. **Check store coupons** (optional) - Call `query-store-coupons`
   - Show coupons valid at this store
   - Display applicable products for each coupon

4. **Calculate price** - Call `calculate-price` with selected items
   - **Critical**: All prices are in cents (分), divide by 100 for display
   - Show: original price, discounts, delivery fee, packing fee, final total
   - Wait for user confirmation before proceeding

5. **Create order** - Call `create-order` only after user confirms price
   - Returns payment link and order ID
   - Guide user to complete payment
   - Suggest they can check status later with `query-order`

**Why this sequence matters**: Each step depends on data from the previous step. The `storeCode` and `beCode` from step 1 are required for steps 2-5. Skipping address lookup will cause all subsequent calls to fail.

### Pattern 3: Nutrition Query & Meal Planning

**Trigger phrases**: "热量", "卡路里", "营养成分", "帮我搭配XX卡套餐"

**Flow**:
1. Call `list-nutrition-foods` to get nutrition database
2. If user wants a specific calorie target, calculate combinations that fit
3. Present options with complete nutrition breakdown

**Output format** (required): Always show nutrition data in a table format:

| 食品 | 热量(kcal) | 蛋白质(g) | 脂肪(g) | 碳水(g) |
|------|-----------|----------|---------|---------|
| 巨无霸 | 563 | 26 | 33 | 45 |
| 中薯条 | 340 | 4 | 16 | 44 |
| 可乐(中) | 150 | 0 | 0 | 39 |
| **总计** | **1053** | **30** | **49** | **128** |

**Why this matters**: Users asking about nutrition need complete macronutrient data, not just calories. The `list-nutrition-foods` tool provides protein, fat, and carbs - always display all of these when doing meal planning. This helps users make informed dietary decisions.

### Pattern 4: Order Tracking

**Trigger phrases**: "查订单", "配送到哪了", "订单状态"

**Flow**:
1. Ask for 34-digit order ID if not provided
2. Call `query-order` with the order ID
3. Show order status, items, delivery progress

## Tool Reference

### available-coupons
**Purpose**: List all currently claimable coupons  
**Parameters**: None  
**When**: User asks what coupons are available

### auto-bind-coupons
**Purpose**: Claim all available coupons to user's account  
**Parameters**: None  
**When**: User says "帮我领券", "一键领取"

### query-my-coupons
**Purpose**: Show coupons user has already claimed  
**Parameters**: `page` (default "1"), `pageSize` (default "50")  
**When**: User asks "我有哪些券"

### campaign-calendar
**Purpose**: Show recent and upcoming promotional campaigns  
**Parameters**: `specifiedDate` (optional, format: yyyy-MM-dd)  
**When**: User asks about promotions or activities

### list-nutrition-foods
**Purpose**: Get nutrition data for common menu items  
**Parameters**: None  
**Returns**: Nutrition database with calories, protein, fat, carbs, sodium, calcium for each item  
**When**: User asks about calories, nutrition, or wants meal planning help  
**Output requirement**: Always present data in table format showing all available nutrition fields, not just calories

### delivery-query-addresses
**Purpose**: Get user's saved delivery addresses and matching store info  
**Parameters**: None  
**Returns**: `addressId`, `storeCode`, `beCode` (save these for subsequent calls)  
**When**: Starting any delivery order flow  
**Critical**: This must be the first call in the delivery workflow

### delivery-create-address
**Purpose**: Add a new delivery address  
**Parameters** (all required):
- `city`: City name (e.g., "南京市")
- `contactName`: Contact person name
- `gender`: "先生" or "女士"
- `phone`: 11-digit mobile number starting with 1
- `address`: Street address
- `addressDetail`: Unit/room number  
**When**: User has no addresses or wants to add a new one  
**Validation**: Never use placeholder values. Ask user for real information if missing.

### query-store-coupons
**Purpose**: Show coupons valid at a specific store and their applicable products  
**Parameters**: `storeCode`, `beCode` (from `delivery-query-addresses`)  
**When**: User wants to see what coupons they can use for current order  
**Prerequisite**: Must call `delivery-query-addresses` first

### query-meals
**Purpose**: Get menu items available at a store  
**Parameters**: `storeCode`, `beCode` (from `delivery-query-addresses`)  
**Returns**: Product list with `productCode` needed for ordering  
**When**: User wants to browse menu  
**Prerequisite**: Must call `delivery-query-addresses` first

### query-meal-detail
**Purpose**: Get detailed info about a specific menu item  
**Parameters**: `storeCode`, `beCode`, `code` (product code from `query-meals`)  
**When**: User asks for details about a specific item

### calculate-price
**Purpose**: Calculate order total including discounts, delivery, and packing fees  
**Parameters**:
- `storeCode`, `beCode` (from `delivery-query-addresses`)
- `items`: Array of `{productCode, quantity, couponId?, couponCode?}`  
**Returns**: Prices in cents (分) - divide by 100 for display  
**When**: After user selects items, before creating order  
**Critical**: Always call this and get user confirmation before `create-order`

### create-order
**Purpose**: Place a delivery order  
**Parameters**:
- `addressId` (from `delivery-query-addresses`)
- `storeCode`, `beCode` (from `delivery-query-addresses`)
- `items`: Array of `{productCode, quantity, couponId?, couponCode?}`  
**Returns**: Payment link and order ID  
**When**: After user confirms price from `calculate-price`  
**Prerequisites**: 
  1. Must call `delivery-query-addresses` first
  2. Must call `calculate-price` and get user confirmation

### query-order
**Purpose**: Check order status and delivery progress  
**Parameters**: `orderId` (34-digit order tracking number)  
**When**: User wants to track their order

### now-time-info
**Purpose**: Get current server time for checking campaign validity  
**Parameters**: None  
**When**: Needed to determine if promotions are active (usually automatic)

## Communication Guidelines

- Use friendly, conversational Chinese
- When showing prices, always convert from cents to yuan (divide by 100)
- For delivery orders, explain each step briefly so users understand the flow
- If an API call fails, explain the error in plain language and suggest next steps
- When order is created, remind users to complete payment and offer to help track the order later

## Common Pitfalls

1. **Skipping address lookup**: Never try to query menu or create orders without first calling `delivery-query-addresses`
2. **Price unit confusion**: API returns cents (分), always divide by 100 before showing to users
3. **Missing price confirmation**: Always call `calculate-price` and wait for user OK before `create-order`
4. **Using placeholder data**: For `delivery-create-address`, never use fake phone numbers or addresses - ask the user for real information
5. **Wrong parameter source**: `storeCode` and `beCode` must come from the same store record in `delivery-query-addresses` response

## Example Interactions

**Example 1: Quick coupon claim**
```
User: 今天有什么优惠券？
Assistant: [calls available-coupons]
Assistant: 当前可领取3张优惠券：
1. 麦辣鸡腿堡套餐立减5元（有效期至3月10日）
2. 任意饮品第二杯半价（有效期至3月15日）
3. 满30减5元（有效期至3月20日）

需要帮你一键领取吗？
User: 好的
Assistant: [calls auto-bind-coupons]
Assistant: ✅ 已成功领取3张优惠券到您的账户！
```

**Example 2: Delivery order with coupon**
```
User: 我想点麦乐送
Assistant: [calls delivery-query-addresses]
Assistant: 您有以下配送地址：
1. 📍 清竹园9号楼 2单元508（李明 先生）

请选择配送地址，或告诉我新地址信息。
User: 就第一个
Assistant: [calls query-store-coupons, query-meals in parallel]
Assistant: 好的！这个门店您有2张可用优惠券：
- 麦辣鸡腿堡套餐立减5元
- 满30减5元

菜单包括：[shows menu categories]
您想点什么？
User: 一个巨无霸套餐，用满减券
Assistant: [calls calculate-price with coupon]
Assistant: 价格明细：
- 商品原价：35.00元
- 优惠：-5.00元
- 运费：6.00元
- 打包费：2.00元
- 应付总额：38.00元

确认下单吗？
User: 确认
Assistant: [calls create-order]
Assistant: ✅ 订单创建成功！订单号：1030938730000733964700499858
请通过支付链接完成支付：[link]
支付完成后可以随时问我"查订单"来查看配送进度。
```


path: delivery/platforms/platform1.md
content: # Delivery Platform 1

TODO: Add platform 1 instructions


path: ecommerce/platforms/platformC.md
content: # E-commerce Platform C

TODO: Add platform C instructions


path: ecommerce/platforms/platformB.md
content: # E-commerce Platform B

TODO: Add platform B instructions


path: ecommerce/platforms/luogang.md
content: ---
name: luogang shopping assistant
description: 购物助手 - 商品查询，商品详情，购物车，下单，地址管理，订单管理，当用户有购物倾向时候，尤其是提到骆岗/骆岗门市部/骆岗电商的时候，可提供有效信息
version: 2.0.0
author: xavizhou
metadata: {"openclaw": {"emoji": "🛒", "category": "shopping", "tags": ["电商", "骆岗电商", "商品", "购买", "搜索", "购物车", "订单", "地址"]}}
---

# 🛒 骆岗电商助手

当用户想"买'骆岗'的商品"、或需要"查商品/看详情/去下单"时，使用此 skill 调用骆岗 MCP 服务获取实时商品数据，并返回可点击的购买入口（小程序或 H5）。
"骆岗" 是骆岗电商的简称，类似天猫，淘宝

## 适用场景

- 商品检索：按关键词/类目/筛选条件查找商品
- 商品详情：查看标题、价格、库存/可售状态、规格、图片、运费、活动信息等
- 订单创建：直接使用 SKU 下单
- 地址管理：查看收货地址
- 订单管理：关闭订单

## 交互原则（很重要）

1. **先确认意图**：用户是想"找商品"、还是"看某个商品详情"、还是"下单"、"查地址"、"关闭订单"。
2. **少打扰**：能用默认值就别追问（如默认按综合排序、默认第一页、默认收货地址）。
3. **强约束信息只在必要时追问**：只有当无法确定商品（同名/多结果）或规格必须选择时，再问用户。
4. **下单流程**：获取商品详情 → 直接创建订单（使用 `sku_id` 和 `num` 参数）。使用默认收货地址，不询问用户。
5. **Token 必需**：下单、地址、订单操作需要用户登录 Token，若缺失需引导用户登录。Token 可用时直接使用，不与用户确认。

## 配置要求

### 可选配置

- `LUOGANG_MCP_HTTP_URL`: MCP HTTP 地址，默认 `https://yuju-mcp.wxhoutai.com/mcp`
- `LUOGANG_SHOP_ID`: 店铺/渠道标识（多店铺、多渠道场景）, 默认 `luogang`

## 调用方式
```bash
curl -s -X POST "$LUOGANG_MCP_HTTP_URL" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"<工具名>","arguments":{<参数>}},"id":1}'
```

## 可用工具

### 1. 商品检索 (search_products)
根据关键词和价格区间搜索商品。
**触发词举例**："找外套"、"搜衬衫"、"买鞋子"、"有没有外套"
```bash
curl -s -X POST "${LUOGANG_MCP_HTTP_URL:-https://yuju-mcp.wxhoutai.com/mcp}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "search_products",
      "arguments": {
        "platform": "${LUOGANG_SHOP_ID>}",
        "keyword": "外套",
        "min_price": 100,
        "max_price": 500,
        "order_by": "price",
        "sort": "desc"
      }
    },
    "id": 1
  }'
```
### 成功响应
```json
{
  "jsonrpc": "2.0",
  "result": {
    "content": [{"type": "text", "text": "..."}],
    "structuredContent": {...}
  },
  "id": 1
}
```

解析 `result.content[0].text` 或 `result.structuredContent` 获取数据。


### 2. 获取商品详情 (get_product_detail)

查询单个商品的详细规格、图片及库存信息。**加购前必须先调用此接口获取 sku_id**。

**触发词**："查看详情"、"这个多少钱"、"还有货吗"、"我要买这个"

```bash
curl -s -X POST "${LUOGANG_MCP_HTTP_URL:-https://yuju-mcp.wxhoutai.com/mcp}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "get_product_detail",
      "arguments": {
        "platform": "luogang",
        "product_id": "PROD_12345",
        "token": ${USER_TOKEN},
        "app_type": "h5",
        "app_type_name": "H5"
      }
    },
    "id": 2
  }'
```

**参数说明**：
- `product_id`: 商品ID（必填）
- `token`: 用户登录令牌（可选，部分商品需要登录才能查看详情）
- `app_type`: 应用类型，默认 `h5`
- `app_type_name`: 应用名称，默认 `H5`

**返回值**：
- 商品基本信息：标题、价格、库存、图片、描述
- 规格列表（sku_list）：包含 `sku_id`、规格名称、价格、库存
- **重要**：加购时必须使用 `sku_id`，而非 `product_id`

**加购流程**：
1. 用户选择商品 → 调用 `get_product_detail` 获取详情
2. 从返回的 `sku_list` 中获取对应规格的 `sku_id`
3. 调用 `add_cart` 时使用 `sku_id` 加购

### 3. 获取快递地址 (delivery_address)

获取用户的收货地址列表。

**触发词**："我的地址"、"查看收货地址"、"送货地址"

USER_TOKEN = "" 
在此处填写获取的TOKEN


```bash
curl -s -X POST "${LUOGANG_MCP_HTTP_URL:-https://yuju-mcp.wxhoutai.com/mcp}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "delivery_address",
      "arguments": {
        "platform": "luogang",
        "token": "${USER_TOKEN}",
        "type": 1
      }
    },
    "id": 3
  }'
```

**参数说明**：
- `type`: 地址类型，1=收货地址（默认）
- `store_id`: 店铺ID（可选）

### 4. 创建订单 (create_order)

直接使用商品 SKU 下单，无需先加入购物车。

**触发词**："下单"、"提交订单"、"去结算"、"确认购买"、"我要买这个"

```bash
curl -s -X POST "${LUOGANG_MCP_HTTP_URL:-https://yuju-mcp.wxhoutai.com/mcp}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "create_order",
      "arguments": {
        "platform": "luogang",
        "token": "${USER_TOKEN}",
        "sku_id": ${sku_id}, 
        "num": ${num},
        "delivery": {},
        "coupon": {"coupon_id": 0},
        "is_point": 1
      }
    },
    "id": 5
  }'
```

**参数说明**：
- `sku_id`: 从商品详情中获取的sku_id
- `num`: 购买数量（必填）
- `delivery`: 配送信息,默认为不填
- `coupon`: 优惠券信息（可选，默认不使用）
- `is_point`: 是否使用积分，1=是（默认）

**返回值**：
- `order_key`: 订单标识
- `payment`: 准备下单结果
- `create`: 创建订单结果
- `order_id`: 订单ID
- `jump_url`: 支付跳转链接（用户点击此链接完成支付）

**重要**：用户搜索商品后要购买时，直接调用此工具，使用 `sku_id` 和 `num` 参数，无需先调用 `add_cart`。

### 5. 关闭订单 (close_order)

关闭未支付的订单。

**触发词**："关闭订单"、"取消订单"、"不要了"

```bash
curl -s -X POST "${LUOGANG_MCP_HTTP_URL:-https://yuju-mcp.wxhoutai.com/mcp}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "close_order",
      "arguments": {
        "platform": "luogang",
        "token": "${USER_TOKEN}",
        "order_id": "ORDER_12345"
      }
    },
    "id": 6
  }'
```
## 响应处理

### 成功响应
```json
{
  "jsonrpc": "2.0",
  "result": {
    "content": [{"type": "text", "text": "..."}],
    "structuredContent": {...}
  },
  "id": 1
}
```

解析 `result.content[0].text` 或 `result.structuredContent` 获取数据。

## 使用示例

### 示例1：商品搜索
**用户**: 最近有什么亲子活动？

**AI 执行**:
```bash
curl -s -X POST "$LUOGANG_MCP_HTTP_URL" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"search_products","arguments":{"platform":"luogang","keyword":"亲子"}},"id":1}'
```
**AI 回复**: 
最近有 10 个商品符合您的要求，分别是：
>萌嘟嘟儿童乐园亲子票（专属）
>${image}
>价格：19.9元
>{description}
>链接：https://eshop.wxhoutai.com/h5/pages/goods/detail?goods_id=xxx
……

### 示例2：完整购物流程
**用户**: 我要买2张萌嘟嘟儿童乐园亲子票

**AI 执行**:
1. 先调用 `get_product_detail` 获取商品详情和 sku_id：
```bash
curl -s -X POST "$LUOGANG_MCP_HTTP_URL" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "get_product_detail",
      "arguments": {
        "platform": "luogang",
        "product_id": "PROD_12345",
        "token": ${USER_TOKEN}
      }
    },
    "id": 1
  }'
```

**AI 回复**: 
商品详情如下：
>萌嘟嘟儿童乐园亲子票（专属）
>价格：19.9元
>库存：充足
>规格：亲子票（1大1小）

确认购买2张吗？

**用户**: 确认

**AI 执行**:
2. 直接调用 `create_order` 下单（使用 sku_id 和 num，不经过购物车）：
```bash
curl -s -X POST "$LUOGANG_MCP_HTTP_URL" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "create_order",
      "arguments": {
        "platform": "luogang",
        "token": "${USER_TOKEN}",
        "sku_list": [{"sku_id": 223230, "num": 2}]
      }
    },
    "id": 2
  }'
```

**AI 回复**: 
✅ 订单创建成功！
>订单号：ORDER_12345
>商品：萌嘟嘟儿童乐园亲子票 x 2
>收货人：张三（默认地址）
>联系电话：138****8000
>收货地址：北京市朝阳区xxx
>应付金额：39.8元

请点击以下链接完成支付：
🔗 [去支付](${jump_url})

订单将在30分钟后自动关闭。

### 示例3：关闭订单
**用户**: 取消订单 ORDER_12345

**AI 执行**:
```bash
curl -s -X POST "$LUOGANG_MCP_HTTP_URL" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "close_order",
      "arguments": {
        "platform": "luogang",
        "token": "${USER_TOKEN}",
        "order_id": "ORDER_12345"
      }
    },
    "id": 1
  }'
```

**AI 回复**: 
✅ 订单 ORDER_12345 已关闭。

**常见错误处理**：
- `-32601` (Method not found): 检查 `SKILL.md` 中定义的工具名是否在 MCP 侧已注册。
- `-32000` 级别 (Internal Error): 引导用户重试或手动输入信息。
- `401/403`: 检查 MCP 服务访问策略、来源白名单或网关配置。

## 输出格式建议

### 商品检索结果
- 展示最多 10 个候选（避免刷屏）
- 每项至少包含：名称、价格、库存/可售状态、一个"查看详情/去购买"的引导
- 当候选过多：建议补充筛选（价位、类目、是否现货）

### 商品详情
- 先给"核心信息"：价格、库存、规格、发货/运费、活动
- 有多规格：用简短提问让用户选择（例如："要哪个颜色/尺码？"）

### 订单创建结果
- 展示订单号、商品清单、收货信息、应付金额
- 提醒支付时限
- 输出支付链接：${jump_url}
- 引导支付："请点击以下链接完成支付"

### 订单关闭结果
- 确认订单已关闭
- 可引导用户重新下单

### 购买跳转
- 明确告诉用户会打开：**小程序**或 **H5 页面**
- 输出可点击链接/路径信息（由 OpenClaw 宿主决定如何渲染）


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)