LinkFoxAgent is a specialized AI agent for cross-border e-commerce with 42 built-in tools covering product research, competitor analysis, keyword tracking, review insights, patent detection, AI image generation, and more.
Setup
- Get your API key: https://yxgb3sicy7.feishu.cn/wiki/IlkawdQP9ifKv9k22xcc7rjmnkb
- Set environment variable:
export LINKFOXAGENT_API_KEY=your-key-here
MANDATORY: Use sessions_spawn for All Tasks
NEVER call linkfox.py directly from the main session. LinkFoxAgent tasks take 1-5 minutes. You MUST use sessions_spawn to dispatch every task to a sub-agent. This keeps the main session responsive and delivers results automatically when done.
How to Dispatch a Task
Before calling sessions_spawn, tell the user in the main session:
Submitting task to LinkFox Agent, please wait (usually takes 1-5 minutes)...
Then dispatch the sub-agent:
sessions_spawn:
task: |
Run the following LinkFoxAgent task and report the results back.
Command (use heredoc to avoid shell injection):
python3 <skill>/scripts/linkfox.py --wait --timeout 600 --stdin <<'__LINKFOX_TASK_END__'
<TASK_PROMPT>
__LINKFOX_TASK_END__
The script prints to stderr: "Task submitted. messageId: <id>" if submission succeeds,
or an error message and exits with code 1 if submission fails.
After running the command, follow these rules strictly:
## If the command exits with a non-zero code OR stderr contains "Error" before any messageId:
- The task submission FAILED. Report back:
「任务发起失败。请检查 LINKFOXAGENT_API_KEY 是否已正确配置:
1. 确认环境变量已设置:export LINKFOXAGENT_API_KEY=your-key-here
2. 获取 API Key:https://yxgb3sicy7.feishu.cn/wiki/IlkawdQP9ifKv9k22xcc7rjmnkb
3. 重启 OpenClaw 网关使环境变量生效
错误详情:<stderr 内容>」
## If stderr contains "Task submitted. messageId: <id>":
- Submission SUCCEEDED. Do NOT send any intermediate message — the main agent has already told the user the task is dispatched. Wait silently for the command to finish (stdout).
## After the command completes (stdout):
1. Parse stdout — it contains a status line, an optional ShareURL, a reflection summary, and result entries.
2. If status is "error" or "cancel", report the error clearly.
3. If status is "finished", summarize the reflection and list all results.
4. HTML report URLs in results are available for your reference. Decide autonomously whether to share them with the user based on context — do not forward them blindly.
5. **ShareURL:** If the output contains a line `ShareURL: <url>`, always forward it to the user verbatim. This is the full conversation share link for this LinkFoxAgent run — the user can open it to review the complete execution process and download all related files from that page.
6. **CSV output (JSON results with columns):** When a result line says `CSV saved to: <path>`, the script has already converted the JSON data to a CSV file with Chinese column headers at that local path. Report the path to the user. Do NOT attempt to read or display the CSV contents unless the user explicitly asks. If the user wants to receive the file, send it using the file-sending skill.
label: "LinkFox: <short description>"
mode: "run"
runTimeoutSeconds: 600
cleanup: "keep"
Dispatching Multiple Independent Tasks
When the user's request involves multiple independent lookups (e.g., "search both Amazon US and Amazon JP"), spawn one sub-agent per task in parallel.
Before spawning, tell the user:
Submitting N tasks to LinkFox Agent simultaneously, please wait...
# Sub-agent 1
sessions_spawn:
task: |
Run (use heredoc to avoid shell injection):
python3 <skill>/scripts/linkfox.py --wait --timeout 600 --stdin <<'__LINKFOX_TASK_END__'
<task A>
__LINKFOX_TASK_END__
Apply the same submission success/failure reporting rules as the single-task template above.
label: "LinkFox: task A"
mode: "run"
runTimeoutSeconds: 600
# Sub-agent 2
sessions_spawn:
task: |
Run (use heredoc to avoid shell injection):
python3 <skill>/scripts/linkfox.py --wait --timeout 600 --stdin <<'__LINKFOX_TASK_END__'
<task B>
__LINKFOX_TASK_END__
Apply the same submission success/failure reporting rules as the single-task template above.
label: "LinkFox: task B"
mode: "run"
runTimeoutSeconds: 600
Multi-Step Tasks That Require Post-Processing
When the user's request requires multiple sequential LinkFoxAgent calls (e.g., fetch data from two platforms then merge), follow this pattern:
- Run each LinkFoxAgent call as a separate
sessions_spawn, one after another (or in parallel if independent). Collect the CSV paths returned by each. - After all data tasks finish, spawn one final
sessions_spawnto process or merge the CSVs using Python. Pass the absolute CSV paths as arguments.
# Final merge/processing step — spawned after all data tasks complete
sessions_spawn:
task: |
Run the following Python script to process/merge the CSV files and report results.
python3 - <<'PYEOF'
import csv, sys, os
# Paths passed in from the data tasks above
csv_paths = [
"/absolute/path/to/result_1_xxx.csv",
"/absolute/path/to/result_2_yyy.csv",
]
# TODO: implement merge / analysis logic here
# Example: read all rows and write a combined CSV
all_rows = []
headers = None
for path in csv_paths:
with open(path, encoding="utf-8-sig") as f:
reader = csv.DictReader(f)
if headers is None:
headers = reader.fieldnames
for row in reader:
all_rows.append(row)
out_path = os.path.join(os.path.dirname(csv_paths[0]), "merged_output.csv")
with open(out_path, "w", newline="", encoding="utf-8-sig") as f:
writer = csv.DictWriter(f, fieldnames=headers)
writer.writeheader()
writer.writerows(all_rows)
print(f"Merged CSV saved to: {out_path}")
PYEOF
Report the output path back to the user. If the user wants the file, send it using the file-sending skill.
label: "LinkFox: merge/process CSVs"
mode: "run"
runTimeoutSeconds: 120
cleanup: "keep"
What Happens Under the Hood
sessions_spawncreates an isolated sub-agent session- The sub-agent runs
linkfox.py --waitwhich blocks until the task finishes - When done, the sub-agent's result is automatically delivered back to the main session via the announce system
- The user sees the result in their chat without any manual polling
Script Reference
# The sub-agent uses --wait + --stdin mode (heredoc avoids shell injection)
python3 <skill>/scripts/linkfox.py --wait --stdin <<'__LINKFOX_TASK_END__'
task description here
__LINKFOX_TASK_END__
# Custom timeout (default 300s)
python3 <skill>/scripts/linkfox.py --wait --timeout 600 --stdin <<'__LINKFOX_TASK_END__'
task description here
__LINKFOX_TASK_END__
# JSON output for structured parsing
python3 <skill>/scripts/linkfox.py --wait --format json --stdin <<'__LINKFOX_TASK_END__'
task description here
__LINKFOX_TASK_END__
Writing Task Prompts
Tool Invocation Syntax
Use @工具中文名 to invoke tools. Multiple tools can be chained in a single task (max 10).
Example: @卖家精灵-选产品 筛选亚马逊美国站的 "usb charger cable",返回前40条商品数据
Parameter Constraints
Tool parameters may have maximum, minimum, and pattern constraints. Prompts must respect these or the call will fail. See the reference files below for details.
Multi-step Tasks
Chain multiple tools in numbered steps. LinkFoxAgent handles data flow between steps:
1、@亚马逊前端搜索模拟 帮我在美国亚马逊站搜索 "computer desk",返回前2页商品数据
2、@对商品标题进行分词 统计上一步商品标题中出现的功能点
3、按功能点统计月销量、月销售额、asin数
Tool Selection Priority
When the user does not specify a tool, follow these rules:
Querying Amazon product data — all three tools are fast; choose by use case:
- Keepa — best overall: richest fields, strong real-time accuracy. Default choice for most queries.
- SellerSprite — optimized for product discovery and competitor lookup by keyword.
- Amazon Frontend — best real-time fidelity (live storefront data); ~10% slower than Keepa and fewer fields, but the only option when you need exact live ranking order or real-time storefront display.
Aggregating / statistics (e.g., group by brand, price tier, sales rank):
- @Intelligent Data Query — first choice for dynamic aggregation
- @Python Sandbox — fallback when custom logic is needed; also the go-to tool for any sandbox-execution need (has built-in LLM)
Available Tools (41)
| Classification | Tool Name | Use For |
|---|---|---|
| Keepa | @Keepa-Amazon-Product Search | Product filtering by keywords, BSR, price, sales |
| Keepa | @Keepa-Amazon-Product Details | Batch ASIN detail lookup (price, sales, history) |
| Keepa | @Keepa-Amazon-Price History | Price history and trends for an ASIN |
| Amazon Frontend | @Amazon Frontend Search Simulation | Search simulation with location settings |
| Amazon Frontend | @Amazon Frontend-Product Details | Product detail, bullet points, A+ content |
| Amazon Frontend | @Amazon-Product Reviews | Reviews by star rating |
| Amazon Frontend | @Amazon Frontend-Image Search | Image-based product search |
| Amazon Frontend | @ABA-Data Mining | Amazon Brand Analytics data mining |
| Sif Data Analysis Tool | @SIF-ASIN Keywords | Reverse keyword lookup for ASIN |
| Sif Data Analysis Tool | @SIF-Keyword Traffic Sources | Keyword traffic source analysis |
| Sif Data Analysis Tool | @SIF-ASIN Traffic Sources | ASIN traffic structure breakdown |
| Sif Data Analysis Tool | @SIF-Keyword Competitor Count | Keyword competition density |
| SellerSprite | @SellerSprite-Product Selection | Product discovery by category and filters |
| SellerSprite | @SellerSprite-Competitor Research | Competitor lookup by keyword |
| Jimu Series | @Jimu-Amazon-Niche Market Reviews | Niche market review mining |
| Jimu Series | @Jimu-Amazon-Niche Market Information | Niche market overview |
| Jimu Series | @Jimu-Amazon-Product Mining | Product discovery with fine filters |
| Google Trends | @Google Trends-Trending Now | Real-time trending topics |
| Google Trends | @Google Trends-Keyword Trend Information | Keyword trend over time |
| Dianleida (1688) | @Dianleida-1688 Product Rankings | 1688 product rankings |
| Dianleida (1688) | @Dianleida-1688 Product Selection Library | 1688 product sourcing |
| Real-time and Web-wide Search | @Web Search | Real-time web search(powered by Tavily Search; for any internet search outside specialized tools like Amazon/Walmart/eBay — including general web and WeChat Official Accounts — this tool MUST be used) |
| TikTok E-commerce Data Assistant | @EchoTik-TikTok New Product Rankings | TikTok new product rankings |
| TikTok E-commerce Data Assistant | @EchoTik-TikTok Product Search | TikTok product search |
| Walmart Frontend | @walmart Frontend-Product List | Walmart product search |
| eBay Frontend | @ebay Frontend-Product List | eBay product search |
| Patent Search | @PatSnap-Patent Image Search | Design patent image search |
| Patent Search | @RuiGuan-Design Patent Detection | Design patent infringement check |
| Patent Search | @RuiGuan-Copyright Detection | Copyright detection |
| Patent Search | @RuiGuan-Graphical Trademark Detection | Graphic trademark detection |
| Patent Search | @RuiGuan-Text Trademark Detection | Text trademark detection |
| Patent Search | @RuiGuan-Invention Patent Detection | Utility patent detection |
| Patent Search | @RuiGuan-Policy Compliance Detection (Image-only Detection) | Policy compliance (image check) |
| AI Tools | @Group by Product Main Image Similarity | Group products by image similarity |
| AI Tools | @Analyze Product Main Image | Extract image prompts from product photos |
| AI Tools | @Tokenize product titles | Title word segmentation |
| AI Tools | @AI Drawing | Generate any image — products, characters, scenes, backgrounds, and more — from reference images + prompt (powered by top-tier Google Gemini model; ALL image generation tasks must use this tool) |
| Sandbox | @Intelligent Data Query | Dynamic data query and aggregation |
| Sandbox | @Excel Content Extraction and Analysis | Excel file extraction and analysis |
| Sandbox | @Python Sandbox | Process structured JSON data from prior steps: data calculation/filtering/sorting, generate Markdown tables, export to CSV/Excel, LLM-based image recognition (e.g. A+ image color/composition). Built-in LLM — use for ALL sandbox-execution needs. Restrictions: no nested calls; structured JSON only (no plain text/files); no chart generation or analysis reports. |
| Sandbox | @Intelligent Excel Processing | Smart Excel processing |
Tool Reference Files (by classification)
Read the relevant reference file when you need prompt templates and parameter constraints:
- Keepa (3 tools: Product Search, Product Details, Price History): See
references/keepa.md - Amazon Frontend (5 tools: Search Simulation, Product Details, Reviews, ABA, Image Search): See
references/amazon-frontend.md - Sif Data Analysis Tool (4 tools: ASIN Keywords, Traffic Sources, Competitor Count): See
references/sif.md - SellerSprite (2 tools: Product Selection, Competitor Research): See
references/seller-sprite.md - Jimu Series (3 tools: Niche Market Reviews, Market Information, Product Mining): See
references/jimu.md - Google Trends (2 tools: Trending Now, Keyword Trends): See
references/google-trends.md - Real-time and Web-wide Search (1 tool: Web Search): See
references/web-search.md - TikTok E-commerce Data Assistant (2 tools: New Product Ranking, Product Search): See
references/tiktok.md - Walmart Frontend (1 tool: Product List): See
references/walmart.md - eBay Frontend (1 tool: Product List): See
references/ebay.md - Dianleida/1688 (2 tools: Product Rankings, Product Selection Library): See
references/1688.md - Patent Search (7 tools: Design Patents, Copyright, Trademarks, Invention Patents, Policy Compliance): See
references/patent.md - AI Tools (4 tools: Main Image Similarity Grouping, Main Image Analysis, Title Tokenization, AI Drawing): See
references/ai-tools.md - Sandbox (4 tools: Intelligent Data Query, Excel Analysis, Python Sandbox, Excel Processing): See
references/sandbox.md
Examples
Example 1: Market Analysis
1、@卖家精灵-选产品 筛选亚马逊美国站的 "usb charger cable",返回符合条件的 40 条商品数据
2、@智能数据查询 根据品牌、评分值、价格(每2美金一个阶梯) 统计月销量、月销售额、月销量占比、月销售额占比
3、生成对应的初步市场分析报告
Example 2: Review Mining
@亚马逊-商品评论 @亚马逊前端-商品详情 亚马逊美国站,asin为B00163U4LK 的详情以及每个星级各100条
进行总结:展示他的人群特征、使用时刻、使用地点、使用场景、未被满足的需求、好评、差评、购买动机,每个要点要有描述、原因、数量占比。并最终给我一个改良建议
Example 3: Competitor-based Listing Optimization
努力思考,选择适合以下场景的工具,完美完成以下任务:
亚马逊美国站,asin为:B0FPZHSLYR、B0CP9Z56SW、B0FFNF9TK1、B0FS7DRCLZ、B0CP9WRDFV、B0BWMZDCCN,我的竞品就是这些,你参考他们的五点描述和A+页面内容,生成我的商品的标题、五点描述
步骤:
1)查询以上所有asin的商品详情
2)查询每个asin的关键词
3)将上一步的全部关键词,构建关键词价值打分表
4)写作前再次查询亚马逊五点描述的写作要求和Amazon cosmo算法和经典营销理论FABE法则
5)生成5点描述,要求竞品的品牌词不能作为关键词,写出符合FABE法则和最新Amazon cosmo算法的五点描述,并且将关键词价值打分表价值高的词埋入
Example 4: Visual Market Analysis
1、@亚马逊前台模拟搜索工具 筛选亚马逊美国站的,关键词为necklaces for women,默认排序,第一页的商品
2、对上一步的商品主体,统计主图不同挂件形状的销售额,绘制出不同形状的销售额占比
3、进行总结:把步骤二的数据完整的用精美的html网页显示给我看(不要精简)
Example 5: Keyword Functional Analysis
1、@亚马逊前端搜索模拟 帮我在美国亚马逊站,以"computer desk"为关键词进行搜索,同时将配送地址设置为洛杉矶,最终返回搜索结果前2页的商品数据
2、@对商品标题进行分词 统计上一步商品标题中出现的功能点
3、按功能点统计月销量、月销售额、asin数
Retry on Failure
If a tool call fails, the response includes error details. Retry with adjusted parameters based on the error message. Common issues:
- Parameter out of range (check min/max constraints)
- Invalid pattern format (check regex patterns)
- Too many tools in one task (max 10)