---
name: meitu-ota-product-import
description: >-
  Imports an OTA vacation / line product page into Meitu ERP via cloud MCP:
  create_product with tripList, then import_product_images to OSS.
  Use when the user pastes an OTA product detail URL or productId and wants
  the line created in Meitu ERP (租户 PAT / MCP).
---

# Meitu · OTA 线路导入 ERP

将 OTA 度假/线路产品页整理成结构化产品，通过美途云端 MCP 创建线路并转存相册。

## Prerequisites

1. Meitu Cloud MCP configured (Streamable HTTP) with tenant PAT:
   - Endpoint: `https://service.meitu.io/api/mcp` (or customer domain)
   - Header: `Authorization: Bearer <API_Token>`
2. Browser automation available (Playwright / IDE browser) when the OTA page is a SPA.
3. Write tools require `confirm: true`.
4. Do **not** embed tokens in this skill or commit them to git.

Token: ERP 管理台「用户 → OpenAPI Token」。Docs: https://meitu.io/mcp

## Workflow

Copy and track:

```
- [ ] 1. Open OTA product detail URL / resolve productId
- [ ] 2. Extract intro + trip outline (+ album URLs)
- [ ] 3. Map to create_product JSON
- [ ] 4. MCP create_product (confirm=true)
- [ ] 5. Batch import_product_images (≤10 URLs per call)
- [ ] 6. Report productId, tripCount, image success/fail
```

### 1. Open page

Use the OTA product detail URL or ID the user provides (desktop or mobile). Open the full multi-day itinerary view when the page only shows a summary.

### 2. Extract

Extract Chinese copy as shown:

| Field | Source hints |
|-------|----------------|
| lineName / titles | Product title / 卖点 |
| lineDays / lineNights | e.g. 6日5晚 |
| fromCityName / toCityName | 出发地 / 主目的地 |
| goTransport / returnTransport | Usually 飞机 |
| recommendReason / character | 卖点、特色、标签 |
| tripList[] | Per-day title, description, meals, hotel |
| coverImages | Absolute `https` album image URLs |

Rules:

- Prefer the default / primary package when multiple packages exist.
- Compact `tripDescription` (no endless HTML dump).
- Absolute `https` image URLs only; dedupe; skip UI chrome (icons/stars/logos).
- Prefer larger image variants when the OTA page offers size options.

### 3. Map to `create_product`

Required: `lineName`, `confirm: true`.

Optional: `lineMainTitle`, `lineSubhead`, `lineDays`, `lineNights`, `fromCityName`, `toCityName`, `goTransport`, `returnTransport`, `keyWords`, `recommendReason`, `character`, `status` (default 1), `tripList`.

`tripList` item shape:

```json
{
  "tripDays": 1,
  "tripTitle": "...",
  "tripDescription": "...",
  "breakFastInfo": "...",
  "lunchInfo": "...",
  "supperInfo": "...",
  "hotelInfo": "..."
}
```

Trip outline only — no detail nodes.

### 4. Call MCP `create_product`

Streamable HTTP session: `initialize` → `notifications/initialized` → `tools/call`.

Return `productId` and `tripCount` from tool result.

### 5. Import images (store to OSS — preferred)

Do **not** hotlink third-party CDN URLs long-term for production albums.

Tool: `import_product_images`  
Args: `productId`, `imageUrls[]`, `confirm: true`

Or Open API: `POST /api/open/erp/v1/products/images/import` with `{ productId, imageUrls }`.

**Batch size ≤ 10** per request (server `maxImages` default). Loop remaining URLs.

### 6. Report

Tell the user: `productId`, days written, images success/fail, and refresh ERP product detail.

## Compliance

- Only import catalogs the tenant is authorized to use; respect each OTA’s terms and robots rules.
- Prefer storing images in Meitu OSS over permanent hotlinks.
- Never paste PAT into skill files, repos, or public pages.

## More

- Field & tool reference: [reference.md](reference.md)
- Pack index (AI): https://meitu.io/skills/index.json
- Human install zip: https://meitu.io/skills/meitu-agent-skills.zip
