newegg-pc-builder
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNewegg PC Builder MCP Skill
Newegg PC Builder MCP Skill
Connects Claude to the Newegg PC Builder MCP service. This skill is
fully dynamic: it discovers available tools at runtime and lets the LLM
decide which tool to call and how to fill its parameters. No tool names or
parameter names are hard-coded, so the skill continues to work even after
the MCP server updates its API.
Required header on every request: all calls to must carry in addition to . It identifies the calling skill to the endpoint — include it even when you assemble a request by hand rather than copying an example below.
apis.newegg.com/ex-mcp/...x-skill: newegg-pc-builderContent-TypeMCP Endpoint:
Script:
https://apis.newegg.com/ex-mcp/endpoint/pcbuilderscripts/mcp_client.py将Claude连接至Newegg PC Builder MCP服务。此Skill是完全动态的:它会在运行时发现可用工具,让LLM决定调用哪个工具以及如何填充参数。工具名称或参数名称均未硬编码,因此即使MCP服务器更新其API,该Skill仍能正常工作。
每个请求的必填请求头:所有对的调用,除外,还必须携带。它用于向端点标识调用方Skill——即使你手动组装请求而非复制下方示例,也需包含此请求头。
apis.newegg.com/ex-mcp/...Content-Typex-skill: newegg-pc-builderMCP端点:
脚本:
https://apis.newegg.com/ex-mcp/endpoint/pcbuilderscripts/mcp_client.pyCore Workflow (always follow this order)
核心工作流程(请始终遵循此顺序)
Step 1 — Discover tools
步骤1 — 发现工具
Always start by listing available tools. Never assume tool names or parameters
from previous runs or documentation.
bash
python scripts/mcp_client.py list_toolsThe output contains, for each tool:
- — identifier to use when calling
name - — what it does (may be empty; infer from name + schema)
description - — available parameters with types and descriptions
inputSchema.properties - — mandatory parameters
inputSchema.required
始终先列出可用工具。切勿假设工具名称或参数与之前运行或文档中的一致。
bash
python scripts/mcp_client.py list_tools输出包含每个工具的以下信息:
- — 调用时使用的标识符
name - — 工具功能(可能为空;可从名称+架构推断)
description - — 可用参数及其类型和描述
inputSchema.properties - — 必填参数
inputSchema.required
Step 2 — Select tool and map parameters
步骤2 — 选择工具并映射参数
Read the output and decide:
list_tools-
Which tool best matches the user's intent?
- Match on description first; fall back to inferring from name + param names
- If multiple tools apply, prefer the most specific one
- If still ambiguous, pick the first one and note the assumption
-
How does user intent map to parameters?
- Only use parameters present in
inputSchema.properties - Free-text params (e.g. ,
question,query): pass the user's request as a natural-language string describing their needtext - Typed/enum params: map user intent to the closest valid value
- Leave optional params unset unless you have a clear value
- Never invent parameters not present in the schema
- Only use parameters present in
阅读的输出并决定:
list_tools-
哪个工具最符合用户意图?
- 优先匹配描述;若描述为空,可从工具名称+参数名称推断
- 若多个工具适用,选择最具体的一个
- 若仍存在歧义,选择第一个工具并注明此假设
-
用户意图如何映射到参数?
- 仅使用中存在的参数
inputSchema.properties - 自由文本参数(如、
question、query):将用户请求作为描述其需求的自然语言字符串传递text - 类型/枚举参数:将用户意图映射到最接近的有效值
- 可选参数若无明确值则留空
- 切勿创建架构中不存在的参数
- 仅使用
Step 3 — Call the tool
步骤3 — 调用工具
bash
python scripts/mcp_client.py call <tool_name> '<json_arguments>'Tool name and arguments are determined at runtime from Step 2. Example:
bash
python scripts/mcp_client.py call v2allin '{"question": "gaming PC RTX 5090 9800X3D best price"}'Windows PowerShell (important)
PowerShell parses outer double quotes before Python runs. Using inside often breaks the JSON string (you may see errors like or “invalid JSON”). Prefer one of:
PowerShell parses outer double quotes before Python runs. Using
\"...\""..."Got: {\-
Single-quote the whole JSON (no backslash escapes needed):powershell
python scripts/mcp_client.py call v2allin '{"question": "gaming PC RTX 3070"}' -
JSON in a file (most reliable for long or nested payloads):powershell
Set-Content -Path args.json -Encoding utf8 '{"question": "gaming PC RTX 3070"}' python scripts/mcp_client.py call v2allin @args.json -
Stdin (pipe or redirect):powershell
'{"question": "gaming PC RTX 3070"}' | python scripts/mcp_client.py call v2allin -
The script supports and for stdin so shells never need to escape inner double quotes.
@path\to\file.json-Where to change things
- Skill + script (recommended): keep examples and in sync — document PowerShell rules here, and use
mcp_client.py/@filein the client to avoid quoting bugs.- - Repo-only docs do not fix agents that load this skill from ; updating the skill is the right place for portable behavior.
~/.agents
bash
python scripts/mcp_client.py call <tool_name> '<json_arguments>'工具名称和参数由步骤2在运行时确定。示例:
bash
python scripts/mcp_client.py call v2allin '{"question": "gaming PC RTX 5090 9800X3D best price"}'Windows PowerShell(重要提示)
PowerShell会在Python运行前解析外层双引号。在内使用通常会破坏JSON字符串(你可能会看到或“无效JSON”等错误)。推荐使用以下方式之一:
PowerShell会在Python运行前解析外层双引号。在
"..."\"...\"Got: {\-
用单引号包裹整个JSON(无需反斜杠转义):powershell
python scripts/mcp_client.py call v2allin '{"question": "gaming PC RTX 3070"}' -
将JSON存入文件(对于长或嵌套的负载最可靠):powershell
Set-Content -Path args.json -Encoding utf8 '{"question": "gaming PC RTX 3070"}' python scripts/mcp_client.py call v2allin @args.json -
通过标准输入(Stdin)传递(管道或重定向):powershell
'{"question": "gaming PC RTX 3070"}' | python scripts/mcp_client.py call v2allin -
脚本支持和(表示标准输入),因此Shell无需转义内部双引号。
@path\to\file.json-修改建议
- Skill + 脚本(推荐):保持示例与同步——在此处记录PowerShell规则,并在客户端中使用
mcp_client.py/@file以避免引号错误。- - 仅仓库文档无法修复从加载此Skill的代理;更新Skill才是实现可移植行为的正确方式。
~/.agents
Step 4 — Interpret the response
步骤4 — 解析响应
Parse the JSON output. Common response shapes:
json
{ "result": { "summary": "...", "popular": [...], "valued": [...] } }- non-null → use as the primary answer text
summary - /
populararrays present → list the buildsvalued - All result fields null → service returned no data; tell the user and offer to answer from general knowledge instead
- → report the error and suggest retry
isError: true
解析JSON输出。常见响应格式:
json
{ "result": { "summary": "...", "popular": [...], "valued": [...] } }- 非空 → 将其作为主要回答文本
summary - 存在/
popular数组 → 列出装机配置valued - 所有结果字段均为空 → 服务未返回数据;告知用户并提议改用通用知识回答
- → 报告错误并建议重试
isError: true
Step 5 — Present results
步骤5 — 展示结果
- Build list: name, total price, key components, brief description
- Compatibility check: clear yes/no with reasoning
- Component details: specs, price, compatibility notes
- No results from API: explain clearly, then offer a manual recommendation
- 装机配置列表:名称、总价、核心组件、简要描述
- 兼容性检查:明确的是/否结论及理由
- 组件详情:规格、价格、兼容性说明
- API无结果:清晰说明情况,然后提供手动推荐
Edge case handling
边缘情况处理
| Situation | Action |
|---|---|
| Report service unavailable; answer from training knowledge |
| Tool description is empty | Infer purpose from name + parameter names |
Schema has no | Treat all params as optional; pass what you have |
| All response fields null | No data for this query; say so and fall back to general knowledge |
HTTP error on | Report error; do not proceed to call step |
HTTP error on | Retry once; if still failing, fall back to general knowledge |
| Multiple tools match | Pick most specific; briefly note the choice |
| 场景 | 操作 |
|---|---|
| 报告服务不可用;使用训练知识回答 |
| 工具描述为空 | 从工具名称+参数名称推断用途 |
架构无 | 将所有参数视为可选;传递已有参数 |
| 所有响应字段为空 | 无此查询的数据;告知用户并 fallback 到通用知识 |
| 报告错误;不进入调用步骤 |
| 重试一次;若仍失败,fallback到通用知识 |
| 多个工具匹配 | 选择最具体的工具;简要说明此选择 |
Script reference
脚本参考
scripts/mcp_client.pyapplication/jsontext/event-streampython scripts/mcp_client.py list_tools
→ prints all tools with full parameter schemas
python scripts/mcp_client.py call <tool_name> '<json_args>'
→ calls the tool and prints the JSON response
python scripts/mcp_client.py call <tool_name> @args.json
→ reads JSON arguments from a UTF-8 file (good on Windows)
echo '<json>' | python scripts/mcp_client.py call <tool_name> -
→ reads JSON from stdinErrors go to stderr with a non-zero exit code. Invalid JSON prints a short hint for PowerShell users.
scripts/mcp_client.pyapplication/jsontext/event-streampython scripts/mcp_client.py list_tools
→ 打印所有工具及完整参数架构
python scripts/mcp_client.py call <tool_name> '<json_args>'
→ 调用工具并打印JSON响应
python scripts/mcp_client.py call <tool_name> @args.json
→ 从UTF-8文件读取JSON参数(适用于Windows)
echo '<json>' | python scripts/mcp_client.py call <tool_name> -
→ 从标准输入读取JSON错误会输出到stderr并返回非零退出码。无效JSON会向PowerShell用户打印简短提示。