Skill: onsoul/fore-vip-product (version 1.0.0)

--- name: product description: AI Agents Skills - Query product catalog from fore.vip platform via MCP Server. Browse AI products, activities, events, and more. Compatible with OpenClaw, Hub, and MCP protocols. version: 0.0.3 license: MIT keywords: - AI Agents - Skills - MCP Server - OpenClaw - Product Catalog - AI Products - Activities - Events - Hub - fore.vip - 产品查询 - AI 智能体 --- # Product Query Skill - AI Agents Skills for fore.vip Query and browse the **AI product catalog** (KL collection) from the **fore.vip platform** via **MCP Server**. This **AI Agent Skill** is designed for **OpenClaw**, **Hub**, and other MCP-compatible platforms. ## 🔥 Popular Keywords **AI Agents** | **Skills** | **MCP Server** | **OpenClaw** | **Product** | **活动 (Activities)** | **Hub** | **AI 智能体** | **fore.vip** | **产品目录** ## 📋 When to Use Use this **AI Agent Skill** when you want to: - 🤖 Browse **AI products** and **AI agents** on fore.vip platform - 🏷️ Search **products** by tag (e.g., "推荐", "热门", "新品", "游戏", "AI") - 📦 View **product details** (name, description, images, URLs) - 📑 Get paginated **product lists** with **SEO-optimized** metadata - 🎯 Discover **activities** and **events** related to products - 🔗 Access **product hub** links for **OpenClaw** integration ## 🌐 MCP Server Configuration ### Architecture The **fore.vip MCP Server** provides two endpoints for **AI Agents** and **Skills** integration: 1. **Direct MCP Endpoint** (Recommended) - `https://api.fore.vip/mcp/*` 2. **Tools Protocol Endpoint** (MCP Standard) - `https://api.fore.vip/tools/*` ### Endpoints | Endpoint | Method | Usage | Recommended | |----------|--------|-------|-------------| | `/mcp/query_kl` | POST | Query **products** (direct) | ⭐⭐⭐⭐⭐ | | `/mcp/create_activity` | POST | Create **activities** (direct) | ⭐⭐⭐⭐⭐ | | `/tools/list` | GET | List tools (MCP standard) | ⭐⭐⭐ | | `/tools/call` | POST | Call tool (MCP standard) | ⭐⭐⭐ | ### Direct Call (Recommended for OpenClaw & Hub) ```bash curl -X POST https://api.fore.vip/mcp/query_kl \ -H "Content-Type: application/json" \ -d '{ "tag": "推荐", "limit": 10 }' ``` **Response**: ```json { "success": true, "total": 10, "limit": 10, "skip": 0, "hasMore": false, "data": [ { "id": "670703627ae7081fd93d09f1", "name": "AI 文案助手", "content": "请你扮演一个优质 AI 文案助手...", "pic": [], "tag": "推荐", "hot": 21307866, "update_date": 1234567890 } ] } ``` ### Via Tools Protocol (MCP Standard for AI Agents) ```bash curl -X POST https://api.fore.vip/tools/call \ -H "Content-Type: application/json" \ -d '{ "name": "query_kl", "arguments": { "tag": "推荐", "limit": 10 } }' ``` **Response**: ```json { "jsonrpc": "2.0", "result": { "content": [{ "type": "text", "text": "{\"success\":true,\"total\":10,...}" }], "isError": false } } ``` ## 📝 Parameters ### Optional | Parameter | Type | Default | Description | Example | |-----------|------|---------|-------------|---------| | `tag` | string | - | **Product** tag to filter (AI, 活动，游戏，etc.) | `"推荐"` | | `limit` | number | `20` | Max results (1-100) | `50` | | `skip` | number | `0` | Skip for pagination | `20` | ## 🚀 Steps for AI Agents 1. **Collect search parameters from user** - Ask for **product tag/category** (optional: AI, 活动，游戏，热门) - Ask for number of results (default: 20, max: 100) - Ask for page number (for pagination) 2. **Validate parameters** - Ensure limit is between 1-100 - Ensure skip is non-negative 3. **Call MCP Server** (OpenClaw & Hub Compatible) ```javascript const response = await fetch('https://api.fore.vip/mcp/query_kl', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ tag: '推荐', limit: 10, skip: 0 }) }); const result = await response.json(); ``` 4. **Handle response** - If `result.success === true`: Display **product list** - Show total count and pagination info - If `result.success === false`: Show error message 5. **Display products** (SEO-Optimized Format) - Show **product name**, description, images - Include **product URL**: `https://fore.vip/p?id={id}` - Provide navigation for next/previous page - Add **keywords**: AI Agents, Skills, MCP, OpenClaw, Hub ## 📦 Example Request ```json { "tag": "推荐", "limit": 10, "skip": 0 } ``` ## 📊 Example Response ```json { "success": true, "total": 10, "limit": 10, "skip": 0, "hasMore": false, "data": [ { "id": "670703627ae7081fd93d09f1", "name": "AI 文案助手", "content": "请你扮演一个优质 AI 文案助手...", "pic": [], "tag": "推荐", "hot": 21307866, "update_date": 1234567890, "url": "https://fore.vip/p?id=670703627ae7081fd93d09f1" } ] } ``` ## 🔗 Product URL Pattern Each **product** can be accessed via the following URL pattern: ``` https://fore.vip/p?id={product_id} ``` **Example**: - Product ID: `670703627ae7081fd93d09f1` - Product URL: `https://fore.vip/p?id=670703627ae7081fd93d09f1` ### Display Format (SEO-Optimized for AI Agents & OpenClaw) When displaying **products**, include the clickable URL: ```markdown - **[产品名]** (热度：xxx) - AI Agents Skills - 简介：产品描述内容... - 🏷️ 标签：tag - 🔗 链接：https://fore.vip/p?id=产品 ID - 🌐 平台：fore.vip | OpenClaw | Hub | MCP ``` ## ⚠️ Error Handling Common errors for **AI Agents** and **Skills**: - Invalid limit value (must be 1-100) - Invalid skip value (must be >= 0) - Network errors (MCP Server timeout) - Authentication errors (OpenClaw & Hub) ## 💻 Implementation Details **Cloud Object URL Trigger**: - After URL triggering, POST request body is a **string** - Must use `this.getHttpInfo().body` to get the body - Must manually `JSON.parse()` to convert string to object ```javascript // Cloud Object Code (mcp/index.obj.js) async query_kl() { const httpInfo = this.getHttpInfo(); const pm = JSON.parse(httpInfo.body); // String → Object const { tag, limit = 20, skip = 0 } = pm; // ... business logic } ``` ## 📌 Notes - Default limit is 20, maximum is 100 - Use `skip` for pagination (skip = (page-1) * limit) - **Products** are sorted by hot (desc) and update_date (desc) - Images are returned as arrays of image objects - The skill uses **MCP Server protocol** for **AI Agents** communication - **Each product has an accessible URL**: `https://fore.vip/p?id={id}` - Compatible with **OpenClaw**, **Hub**, and other **MCP platforms** - **SEO Keywords**: AI Agents, Skills, MCP, Product, 活动，OpenClaw, Hub, fore.vip ## 🏷️ SEO Metadata **Primary Keywords**: - AI Agents Skills - MCP Server - OpenClaw Skills - Product Catalog - fore.vip Products - AI 智能体技能 - 产品查询 - 活动管理 **Secondary Keywords**: - Hub Integration - Activity Creation - AI Product Discovery - MCP Protocol - Agent Skills Marketplace - 智能体产品目录 - OpenClaw 插件 **Long-tail Keywords**: - How to query products with AI Agents - fore.vip MCP Server integration - OpenClaw product search skill - Create activities with MCP protocol - AI Agents skills for product management - 如何使用 AI 智能体查询产品 - fore.vip 平台产品目录 API --- **Version**: 0.0.3 (SEO Optimized) **Last Updated**: 2026-03-22 **Compatible With**: OpenClaw, Hub, MCP Server, AI Agents **Platform**: fore.vip

path: test_local.sh
content: #!/bin/bash

# Product MCP Skill - Local Test Script
# Tests the query_kl tool via MCP Server

API_BASE="https://api.fore.vip"
MCP_TOOLS_LIST="${API_BASE}/mcp/tools/list"
MCP_TOOLS_CALL="${API_BASE}/mcp/tools/call"

echo "======================================"
echo "Product Catalog MCP Skill - Test"
echo "======================================"
echo ""

# Test 1: Get Tools List
echo "Test 1: Getting tools list..."
echo "URL: ${MCP_TOOLS_LIST}"
echo ""

tools_list=$(curl -s "${MCP_TOOLS_LIST}")
echo "${tools_list}" | python3 -m json.tool 2>/dev/null || echo "${tools_list}"
echo ""

# Check if query_kl is in the list
if echo "${tools_list}" | grep -q "query_kl"; then
    echo "✅ query_kl tool found in tools list"
else
    echo "❌ query_kl tool NOT found in tools list"
    exit 1
fi
echo ""

# Test 2: Query all products (no tag filter)
echo "Test 2: Query all products (no tag filter)..."
echo ""

result=$(curl -s -X POST "${MCP_TOOLS_CALL}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "query_kl",
    "arguments": {
      "limit": 5,
      "skip": 0
    }
  }')

echo "${result}" | python3 -m json.tool 2>/dev/null || echo "${result}"
echo ""

# Check success
if echo "${result}" | grep -q '"success": true'; then
    echo "✅ Query all products successful"
else
    echo "❌ Query all products failed"
    exit 1
fi
echo ""

# Test 3: Query products by tag
echo "Test 3: Query products by tag (推荐)..."
echo ""

result=$(curl -s -X POST "${MCP_TOOLS_CALL}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "query_kl",
    "arguments": {
      "tag": "推荐",
      "limit": 10,
      "skip": 0
    }
  }')

echo "${result}" | python3 -m json.tool 2>/dev/null || echo "${result}"
echo ""

# Check success
if echo "${result}" | grep -q '"success": true'; then
    echo "✅ Query by tag successful"
else
    echo "❌ Query by tag failed"
    exit 1
fi
echo ""

# Test 4: Test pagination
echo "Test 4: Test pagination (skip=5, limit=3)..."
echo ""

result=$(curl -s -X POST "${MCP_TOOLS_CALL}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "query_kl",
    "arguments": {
      "limit": 3,
      "skip": 5
    }
  }')

echo "${result}" | python3 -m json.tool 2>/dev/null || echo "${result}"
echo ""

# Check success
if echo "${result}" | grep -q '"success": true'; then
    echo "✅ Pagination test successful"
else
    echo "❌ Pagination test failed"
    exit 1
fi
echo ""

# Test 5: Test invalid tool name
echo "Test 5: Test invalid tool name..."
echo ""

result=$(curl -s -X POST "${MCP_TOOLS_CALL}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "invalid_tool",
    "arguments": {}
  }')

echo "${result}" | python3 -m json.tool 2>/dev/null || echo "${result}"
echo ""

# Check error
if echo "${result}" | grep -q '"error"'; then
    echo "✅ Invalid tool error handling correct"
else
    echo "❌ Invalid tool error handling failed"
    exit 1
fi
echo ""

echo "======================================"
echo "All tests passed! ✅"
echo "======================================"


path: README.md
content: # product Skill - Product Query

[![Version](https://img.shields.io/badge/version-0.0.2-blue)](https://github.com/fore-vip/skills/tree/main/product)
[![License](https://img.shields.io/badge/license-MIT-green)](../LICENSE)

Query and browse product catalog from the fore.vip platform via MCP Server.

---

## 📋 Description

This skill enables AI agents to query and browse products from the fore.vip platform. It supports tag-based filtering, pagination, and returns product details including name, description, images, and metadata.

---

## 🚀 Installation

```bash
# Install from GitHub
npx skills add fore-vip/skills --skill product

# Install from local path
npx skills add /path/to/skills --skill product
```

---

## 🔧 MCP Server Configuration

**Endpoint**: `https://api.fore.vip/mcp/query_kl`  
**Method**: `POST`  
**Content-Type**: `application/json`

---

## 📝 Parameters

### Optional

| Parameter | Type | Default | Description | Example |
|-----------|------|---------|-------------|---------|
| `tag` | string | - | Product tag to filter | `"推荐"` |
| `limit` | number | `20` | Max results (1-100) | `50` |
| `skip` | number | `0` | Skip for pagination | `20` |

---

## 💡 Usage Examples

### Basic Product Query

```javascript
const response = await fetch('https://api.fore.vip/mcp/query_kl', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tag: '推荐',
    limit: 10
  })
});

const result = await response.json();
console.log('Products:', result.data);
```

### With Pagination

```javascript
const page = 2;
const limit = 20;
const skip = (page - 1) * limit;

const response = await fetch('https://api.fore.vip/mcp/query_kl', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tag: '热门',
    limit: limit,
    skip: skip
  })
});

const result = await response.json();
console.log('Page', page, 'Products:', result.data);
console.log('Has more:', result.hasMore);
```

---

## 📊 Response Format

### Success

```json
{
  "success": true,
  "total": 10,
  "limit": 10,
  "skip": 0,
  "hasMore": false,
  "data": [
    {
      "id": "670703627ae7081fd93d09f1",
      "name": "文案助手",
      "content": "请你扮演一个优质文案助手...",
      "pic": [],
      "tag": "推荐",
      "hot": 21307866,
      "update_date": 1234567890
    }
  ]
}
```

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `success` | boolean | Query success status |
| `total` | number | Number of products returned |
| `limit` | number | Requested limit |
| `skip` | number | Requested skip |
| `hasMore` | boolean | Whether more results available |
| `data` | array | Array of product objects |

### Product Object

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Product ID (_id) |
| `name` | string | Product name |
| `content` | string | Product description |
| `pic` | array | Array of image objects |
| `tag` | string | Product tag |
| `hot` | number | Popularity score |
| `update_date` | number | Last update timestamp |

---

## ⚠️ Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Invalid limit value | limit < 1 or limit > 100 | Use value between 1-100 |
| Invalid skip value | skip < 0 | Use non-negative value |
| Network error | Connection issue | Retry with exponential backoff |

---

## 🧪 Testing

```bash
# Run local tests
cd product
./test_local.sh
```

**Test Cases**:
- ✅ Query products by tag
- ✅ Query with pagination
- ✅ Query all products (no tag)

---

## 📚 Related Resources

- **[MCP Specification](https://modelcontextprotocol.io/)** - Protocol docs
- **[skills.sh](https://skills.sh/)** - Skills directory
- **[Fore-Vip](https://fore.vip/)** - Platform website
- **[API Docs](https://api.fore.vip/mcp)** - MCP API

---

## 📝 Version History

### v0.0.2 (2026-03-22)
- ✅ Update to MCP Server standard
- ✅ Simplify SKILL.md format
- ✅ Add architecture documentation
- ✅ Update endpoint to `/mcp/query_kl`

### v0.0.1 (2026-03-21)
- ✅ Initial release

---

## 🤝 Contributing

Contributions welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a PR

---

## 📄 License

MIT License - see [LICENSE](../LICENSE) file.

---

**Maintainer**: wise  
**Last Updated**: 2026-03-22


path: README_cn.md
content: # product 技能 - 产品查询

[![Version](https://img.shields.io/badge/version-0.0.2-blue)](https://github.com/fore-vip/skills/tree/main/product)
[![License](https://img.shields.io/badge/license-MIT-green)](../LICENSE)

通过 MCP Server 查询和浏览 fore.vip 平台的产品目录。

---

## 📋 说明

此技能使 AI 智能体能够查询和浏览 fore.vip 平台的产品。它支持按标签筛选、分页，并返回产品详细信息，包括名称、描述、图片和元数据。

---

## 🚀 安装

```bash
# 从 GitHub 安装
npx skills add fore-vip/skills --skill product

# 从本地路径安装
npx skills add /path/to/skills --skill product
```

---

## 🔧 MCP Server 配置

**端点**: `https://api.fore.vip/mcp/query_kl`  
**方法**: `POST`  
**Content-Type**: `application/json`

---

## 📝 参数

### 可选参数

| 参数 | 类型 | 默认值 | 说明 | 示例 |
|------|------|--------|------|------|
| `tag` | string | - | 产品标签筛选 | `"推荐"` |
| `limit` | number | `20` | 最大结果数 (1-100) | `50` |
| `skip` | number | `0` | 分页跳过数量 | `20` |

---

## 💡 使用示例

### 基础产品查询

```javascript
const response = await fetch('https://api.fore.vip/mcp/query_kl', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tag: '推荐',
    limit: 10
  })
});

const result = await response.json();
console.log('产品列表:', result.data);
```

### 分页查询

```javascript
const page = 2;
const limit = 20;
const skip = (page - 1) * limit;

const response = await fetch('https://api.fore.vip/mcp/query_kl', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tag: '热门',
    limit: limit,
    skip: skip
  })
});

const result = await response.json();
console.log('第', page, '页产品:', result.data);
console.log('更多数据:', result.hasMore);
```

---

## 📊 响应格式

### 成功

```json
{
  "success": true,
  "total": 10,
  "limit": 10,
  "skip": 0,
  "hasMore": false,
  "data": [
    {
      "id": "670703627ae7081fd93d09f1",
      "name": "文案助手",
      "content": "请你扮演一个优质文案助手...",
      "pic": [],
      "tag": "推荐",
      "hot": 21307866,
      "update_date": 1234567890
    }
  ]
}
```

### 响应字段

| 字段 | 类型 | 说明 |
|------|------|------|
| `success` | boolean | 查询成功状态 |
| `total` | number | 返回的产品数量 |
| `limit` | number | 请求的 limit 值 |
| `skip` | number | 请求的 skip 值 |
| `hasMore` | boolean | 是否有更多结果 |
| `data` | array | 产品对象数组 |

### 产品对象

| 字段 | 类型 | 说明 |
|------|------|------|
| `id` | string | 产品 ID (_id) |
| `name` | string | 产品名称 |
| `content` | string | 产品描述 |
| `pic` | array | 图片对象数组 |
| `tag` | string | 产品标签 |
| `hot` | number | 热度分数 |
| `update_date` | number | 最后更新时间戳 |

---

## ⚠️ 错误处理

| 错误 | 原因 | 解决方案 |
|------|------|----------|
| Invalid limit value | limit < 1 或 limit > 100 | 使用 1-100 之间的值 |
| Invalid skip value | skip < 0 | 使用非负值 |
| Network error | 连接问题 | 使用指数退避重试 |

---

## 🧪 测试

```bash
# 运行本地测试
cd product
./test_local.sh
```

**测试用例**:
- ✅ 按标签查询产品
- ✅ 分页查询
- ✅ 查询所有产品（无标签）

---

## 📚 相关资源

- **[MCP 规范](https://modelcontextprotocol.io/)** - 协议文档
- **[skills.sh](https://skills.sh/)** - 技能目录
- **[Fore-Vip](https://fore.vip/)** - 平台官网
- **[API 文档](https://api.fore.vip/mcp)** - MCP API

---

## 📝 版本历史

### v0.0.2 (2026-03-22)
- ✅ 更新为 MCP Server 标准
- ✅ 简化 SKILL.md 格式
- ✅ 添加架构文档
- ✅ 更新端点为 `/mcp/query_kl`

### v0.0.1 (2026-03-21)
- ✅ 初始版本

---

## 🤝 贡献

欢迎贡献！请：
1. Fork 仓库
2. 创建特性分支
3. 进行更改
4. 提交 PR

---

## 📄 许可证

MIT License - 详见 [LICENSE](../LICENSE) 文件

---

**维护者**: wise  
**最后更新**: 2026-03-22


path: README_en.md
content: # product Skill - Product Query

[![Version](https://img.shields.io/badge/version-0.0.2-blue)](https://github.com/fore-vip/skills/tree/main/product)
[![License](https://img.shields.io/badge/license-MIT-green)](../LICENSE)

Query and browse product catalog from the fore.vip platform via MCP Server.

---

## 📋 Description

This skill enables AI agents to query and browse products from the fore.vip platform. It supports tag-based filtering, pagination, and returns product details including name, description, images, and metadata.

---

## 🚀 Installation

```bash
# Install from GitHub
npx skills add fore-vip/skills --skill product

# Install from local path
npx skills add /path/to/skills --skill product
```

---

## 🔧 MCP Server Configuration

**Endpoint**: `https://api.fore.vip/mcp/query_kl`  
**Method**: `POST`  
**Content-Type**: `application/json`

---

## 📝 Parameters

### Optional

| Parameter | Type | Default | Description | Example |
|-----------|------|---------|-------------|---------|
| `tag` | string | - | Product tag to filter | `"推荐"` |
| `limit` | number | `20` | Max results (1-100) | `50` |
| `skip` | number | `0` | Skip for pagination | `20` |

---

## 💡 Usage Examples

### Basic Product Query

```javascript
const response = await fetch('https://api.fore.vip/mcp/query_kl', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tag: '推荐',
    limit: 10
  })
});

const result = await response.json();
console.log('Products:', result.data);
```

### With Pagination

```javascript
const page = 2;
const limit = 20;
const skip = (page - 1) * limit;

const response = await fetch('https://api.fore.vip/mcp/query_kl', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tag: '热门',
    limit: limit,
    skip: skip
  })
});

const result = await response.json();
console.log('Page', page, 'Products:', result.data);
console.log('Has more:', result.hasMore);
```

---

## 📊 Response Format

### Success

```json
{
  "success": true,
  "total": 10,
  "limit": 10,
  "skip": 0,
  "hasMore": false,
  "data": [
    {
      "id": "670703627ae7081fd93d09f1",
      "name": "文案助手",
      "content": "请你扮演一个优质文案助手...",
      "pic": [],
      "tag": "推荐",
      "hot": 21307866,
      "update_date": 1234567890
    }
  ]
}
```

### Response Fields

| Field | Type | Description |
|-------|------|-------------|
| `success` | boolean | Query success status |
| `total` | number | Number of products returned |
| `limit` | number | Requested limit |
| `skip` | number | Requested skip |
| `hasMore` | boolean | Whether more results available |
| `data` | array | Array of product objects |

### Product Object

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Product ID (_id) |
| `name` | string | Product name |
| `content` | string | Product description |
| `pic` | array | Array of image objects |
| `tag` | string | Product tag |
| `hot` | number | Popularity score |
| `update_date` | number | Last update timestamp |

---

## ⚠️ Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| Invalid limit value | limit < 1 or limit > 100 | Use value between 1-100 |
| Invalid skip value | skip < 0 | Use non-negative value |
| Network error | Connection issue | Retry with exponential backoff |

---

## 🧪 Testing

```bash
# Run local tests
cd product
./test_local.sh
```

**Test Cases**:
- ✅ Query products by tag
- ✅ Query with pagination
- ✅ Query all products (no tag)

---

## 📚 Related Resources

- **[MCP Specification](https://modelcontextprotocol.io/)** - Protocol docs
- **[skills.sh](https://skills.sh/)** - Skills directory
- **[Fore-Vip](https://fore.vip/)** - Platform website
- **[API Docs](https://api.fore.vip/mcp)** - MCP API

---

## 📝 Version History

### v0.0.2 (2026-03-22)
- ✅ Update to MCP Server standard
- ✅ Simplify SKILL.md format
- ✅ Add architecture documentation
- ✅ Update endpoint to `/mcp/query_kl`

### v0.0.1 (2026-03-21)
- ✅ Initial release

---

## 🤝 Contributing

Contributions welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a PR

---

## 📄 License

MIT License - see [LICENSE](../LICENSE) file.

---

**Maintainer**: wise  
**Last Updated**: 2026-03-22


path: SKILL_cn.md
content: ---
name: product
description: 查询和浏览前凌智选平台的产品目录。当用户需要发现产品、按标签搜索或查看产品详情时使用。
version: 0.0.1
license: MIT
---

## 描述

通过 MCP Server 查询和浏览前凌智选 (fore.vip) 平台的产品目录 (KL 集合)。

---

## MCP 工具

**工具名称**: `query_kl`  
**服务器**: `fore-vip-mcp`  
**端点**: `https://api.fore.vip/mcp`

---

## 参数

### 可选参数

| 参数 | 类型 | 默认值 | 说明 | 示例 |
|------|------|--------|------|------|
| `tag` | string | - | 产品标签过滤 (如："推荐", "热门", "新品") | `"推荐"` |
| `limit` | number | `20` | 最大返回结果数 (1-100) | `50` |
| `skip` | number | `0` | 分页跳过的结果数 | `20` |

> **注意**: 所有参数均为可选。如果不提供标签，将返回所有按热度排序的产品。

---

## HTTP API 端点

### 获取工具列表

```bash
curl https://api.fore.vip/mcp/tools/list
```

**响应**:
```json
{
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "tools": [
      {
        "name": "create_activity",
        "description": "Create offline event for fore.vip platform..."
      },
      {
        "name": "query_kl",
        "description": "Query products (KL collection) by tag. Returns list of products with name, description, images, and metadata.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "tag": {"type": "string", "description": "Product tag to filter (e.g., \"推荐\", \"热门\", \"新品\")"},
            "limit": {"type": "number", "description": "Maximum number of results to return (default: 20, max: 100)"},
            "skip": {"type": "number", "description": "Number of results to skip for pagination (default: 0)"}
          },
          "required": []
        }
      }
    ]
  }
}
```

### 调用工具

```bash
curl -X POST https://api.fore.vip/mcp/tools/call \
  -H "Content-Type: application/json" \
  -d '{
    "name": "query_kl",
    "arguments": {
      "tag": "推荐",
      "limit": 10,
      "skip": 0
    }
  }'
```

**成功响应**:
```json
{
  "jsonrpc": "2.0",
  "id": null,
  "result": {
    "content": [{
      "type": "text",
      "text": "{\n  \"success\": true,\n  \"total\": 10,\n  \"limit\": 10,\n  \"skip\": 0,\n  \"hasMore\": true,\n  \"data\": [\n    {\n      \"id\": \"kl_xxx\",\n      \"name\": \"产品名称\",\n      \"content\": \"产品描述...\",\n      \"pic\": [\"https://...\"],\n      \"tag\": \"推荐\",\n      \"hot\": 100,\n      \"url\": \"https://example.com\",\n      \"update_date\": 1234567890\n    }\n  ]\n}"
    }],
    "isError": false
  }
}
```

**错误响应**:
```json
{
  "jsonrpc": "2.0",
  "id": null,
  "error": {
    "code": -32000,
    "message": "Tool execution failed"
  }
}
```

---

## 使用示例

### JavaScript (Fetch API)

```javascript
// 按标签查询产品
const result = await fetch('https://api.fore.vip/mcp/tools/call', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    name: 'query_kl',
    arguments: {
      tag: '推荐',
      limit: 20,
      skip: 0
    }
  })
})

const response = await result.json()

// 检查错误
if (response.error) {
  console.error('错误:', response.error.message)
} else {
  const data = JSON.parse(response.result.content[0].text)
  if (data.success) {
    console.log(`找到 ${data.total} 个产品`)
    data.data.forEach(product => {
      console.log(`- ${product.name} (${product.tag})`)
    })
  }
}
```

### 分页示例

```javascript
// 获取第一页
const page1 = await queryProducts({ tag: '热门', limit: 20, skip: 0 })

// 获取第二页
if (page1.hasMore) {
  const page2 = await queryProducts({ tag: '热门', limit: 20, skip: 20 })
}
```

### uniCloud (云函数)

```javascript
const mcp = uniCloud.importObject('mcp')

// 查询产品
const result = await mcp.tools_call({
  name: 'query_kl',
  arguments: {
    tag: '新品',
    limit: 50,
    skip: 0
  }
})

if (result.error) {
  console.error(result.error.message)
} else {
  const data = JSON.parse(result.result.content[0].text)
  console.log('产品列表:', data.data)
}
```

---

## 响应格式

### 成功响应结构

```json
{
  "success": true,
  "total": 20,
  "limit": 20,
  "skip": 0,
  "hasMore": true,
  "data": [
    {
      "id": "kl_xxx",
      "name": "产品名称",
      "content": "产品描述文本...",
      "pic": ["https://example.com/img1.jpg", "https://example.com/img2.jpg"],
      "tag": "推荐",
      "hot": 150,
      "url": "https://example.com/product",
      "update_date": 1711094400000
    }
  ]
}
```

### 响应字段说明

| 字段 | 类型 | 说明 |
|------|------|------|
| `success` | boolean | 查询成功状态 |
| `total` | number | 本次响应返回的产品数量 |
| `limit` | number | 请求的 limit 值 |
| `skip` | number | 请求的 skip 值 |
| `hasMore` | boolean | 是否有更多结果 |
| `data` | array | 产品对象数组 |

### 产品对象字段

| 字段 | 类型 | 说明 |
|------|------|------|
| `id` | string | 产品 ID (kl 集合 _id) |
| `name` | string | 产品名称 |
| `content` | string | 产品描述 |
| `pic` | array | 图片 URL 数组 |
| `tag` | string | 产品标签/分类 |
| `hot` | number | 热度分数 |
| `url` | string | 外部链接 URL |
| `update_date` | number | 最后更新时间戳 (毫秒) |

---

## 错误码

| 代码 | 错误 | 原因 | 解决方案 |
|------|------|------|----------|
| -32602 | `Missing required parameter: name` | 请求中未提供 name 字段 | 在请求体中包含 `name` 字段 |
| -32602 | `Unknown tool: xxx` | 无效的工具名称 | 使用 `query_kl` |
| -32000 | `Tool execution failed` | 数据库查询错误 | 检查服务器日志 |

---

## 前端集成 (产品目录页面)

### Vue 3 组件示例

```vue
<template>
  <view class="product-catalog">
    <!-- 标签筛选 -->
    <o-tab-tag 
      :tags="['全部', '推荐', '热门', '新品']"
      :current="currentTag"
      @change="onTagChange"
    />
    
    <!-- 产品列表 -->
    <scroll-view 
      scroll-y 
      class="product-list"
      @scrolltolower="loadMore"
    >
      <o-card 
        v-for="product in products" 
        :key="product.id"
        :title="product.name"
        :content="product.content"
        :bg="product.pic[0]"
        clickable
        @click="goToProduct(product.id)"
      />
      
      <!-- 无更多提示 -->
      <o-nomore v-if="!hasMore && products.length > 0" />
      
      <!-- 空状态 -->
      <view v-if="products.length === 0" class="empty">
        <text>暂无产品</text>
      </view>
    </scroll-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      currentTag: '全部',
      products: [],
      skip: 0,
      limit: 20,
      hasMore: true,
      loading: false
    }
  },
  
  onLoad() {
    this.loadProducts()
  },
  
  methods: {
    async loadProducts() {
      if (this.loading) return
      
      this.loading = true
      
      try {
        const response = await fetch('https://api.fore.vip/mcp/tools/call', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({
            name: 'query_kl',
            arguments: {
              tag: this.currentTag === '全部' ? '' : this.currentTag,
              limit: this.limit,
              skip: this.skip
            }
          })
        })
        
        const result = await response.json()
        
        if (result.error) {
          uni.showToast({ title: result.error.message, icon: 'none' })
          return
        }
        
        const data = JSON.parse(result.result.content[0].text)
        
        if (data.success) {
          if (this.skip === 0) {
            this.products = data.data
          } else {
            this.products = [...this.products, ...data.data]
          }
          
          this.hasMore = data.hasMore
          this.skip += data.data.length
        }
      } catch (e) {
        console.error(e)
        uni.showToast({ title: '加载失败', icon: 'none' })
      } finally {
        this.loading = false
      }
    },
    
    onTagChange(tag) {
      this.currentTag = tag
      this.skip = 0
      this.products = []
      this.hasMore = true
      this.loadProducts()
    },
    
    loadMore() {
      if (this.hasMore && !this.loading) {
        this.loadProducts()
      }
    },
    
    goToProduct(id) {
      uni.navigateTo({
        url: `/ai/s?id=${id}`
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.product-catalog {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.product-list {
  flex: 1;
  padding: 20rpx;
}

.empty {
  text-align: center;
  padding: 100rpx 0;
  color: #999;
}
</style>
```

---

## 注意事项

1. **标签筛选**: 如果不提供标签或标签为"全部"，将返回所有产品
2. **分页**: 使用 `skip` 和 `limit` 进行分页。检查 `hasMore` 判断是否有更多结果
3. **排序**: 结果按 `hot` (降序) 然后 `update_date` (降序) 排序
4. **图片 URL**: `pic` 字段是图片 URL 数组，使用 `pic[0]` 作为缩略图
5. **产品详情**: 使用产品 `id` 跳转到详情页：`/ai/s?id=${id}`

---

## 相关文件

| 文件 | 路径 |
|------|------|
| MCP 云函数 | `/Users/codes/git/ai/fore/uniCloud-aliyun/cloudfunctions/mcp/index.obj.js` |
| 技能定义 | `/Users/codes/git/ai/skills/product/SKILL.md` |
| 产品详情页 | `/Users/codes/git/ai/fore/ai/s.vue` |

---

**版本**: 0.0.1  
**更新**: 2026-03-21  
**MCP 规范**: https://modelcontextprotocol.io/  
**API**: https://api.fore.vip/mcp  
**平台**: https://fore.vip


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