newegg-pc-builder

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Newegg 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
apis.newegg.com/ex-mcp/...
must carry
x-skill: newegg-pc-builder
in addition to
Content-Type
. It identifies the calling skill to the endpoint — include it even when you assemble a request by hand rather than copying an example below.
MCP Endpoint:
https://apis.newegg.com/ex-mcp/endpoint/pcbuilder
Script:
scripts/mcp_client.py

将Claude连接至Newegg PC Builder MCP服务。此Skill是完全动态的:它会在运行时发现可用工具,让LLM决定调用哪个工具以及如何填充参数。工具名称或参数名称均未硬编码,因此即使MCP服务器更新其API,该Skill仍能正常工作。
每个请求的必填请求头:所有对
apis.newegg.com/ex-mcp/...
的调用,除
Content-Type
外,还必须携带
x-skill: newegg-pc-builder
。它用于向端点标识调用方Skill——即使你手动组装请求而非复制下方示例,也需包含此请求头。
MCP端点
https://apis.newegg.com/ex-mcp/endpoint/pcbuilder
脚本
scripts/mcp_client.py

Core 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_tools
The output contains, for each tool:
  • name
    — identifier to use when calling
  • description
    — what it does (may be empty; infer from name + schema)
  • inputSchema.properties
    — available parameters with types and descriptions
  • inputSchema.required
    — mandatory parameters
始终先列出可用工具。切勿假设工具名称或参数与之前运行或文档中的一致。
bash
python scripts/mcp_client.py list_tools
输出包含每个工具的以下信息:
  • name
    — 调用时使用的标识符
  • description
    — 工具功能(可能为空;可从名称+架构推断)
  • inputSchema.properties
    — 可用参数及其类型和描述
  • inputSchema.required
    — 必填参数

Step 2 — Select tool and map parameters

步骤2 — 选择工具并映射参数

Read the
list_tools
output and decide:
  1. 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
  2. How does user intent map to parameters?
    • Only use parameters present in
      inputSchema.properties
    • Free-text params (e.g.
      question
      ,
      query
      ,
      text
      ): pass the user's request as a natural-language string describing their need
    • 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
阅读
list_tools
的输出并决定:
  1. 哪个工具最符合用户意图?
    • 优先匹配描述;若描述为空,可从工具名称+参数名称推断
    • 若多个工具适用,选择最具体的一个
    • 若仍存在歧义,选择第一个工具并注明此假设
  2. 用户意图如何映射到参数?
    • 仅使用
      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
Got: {\
or “invalid JSON”). Prefer one of:
  1. Single-quote the whole JSON (no backslash escapes needed):
    powershell
    python scripts/mcp_client.py call v2allin '{"question": "gaming PC RTX 3070"}'
  2. 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
  3. Stdin (pipe or redirect):
    powershell
    '{"question": "gaming PC RTX 3070"}' | python scripts/mcp_client.py call v2allin -
The script supports
@path\to\file.json
and
-
for stdin so shells never need to escape inner double quotes.
Where to change things
  • Skill + script (recommended): keep examples and
    mcp_client.py
    in sync — document PowerShell rules here, and use
    @file
    /
    -
    in the client to avoid quoting bugs.
  • Repo-only docs do not fix agents that load this skill from
    ~/.agents
    ; updating the skill is the right place for portable behavior.
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字符串(你可能会看到
Got: {\
或“无效JSON”等错误)。推荐使用以下方式之一:
  1. 用单引号包裹整个JSON(无需反斜杠转义):
    powershell
    python scripts/mcp_client.py call v2allin '{"question": "gaming PC RTX 3070"}'
  2. 将JSON存入文件(对于长或嵌套的负载最可靠):
    powershell
    Set-Content -Path args.json -Encoding utf8 '{"question": "gaming PC RTX 3070"}'
    python scripts/mcp_client.py call v2allin @args.json
  3. 通过标准输入(Stdin)传递(管道或重定向):
    powershell
    '{"question": "gaming PC RTX 3070"}' | python scripts/mcp_client.py call v2allin -
脚本支持
@path\to\file.json
-
(表示标准输入),因此Shell无需转义内部双引号。
修改建议
  • Skill + 脚本(推荐):保持示例与
    mcp_client.py
    同步——在此处记录PowerShell规则,并在客户端中使用
    @file
    /
    -
    以避免引号错误。
  • 仅仓库文档无法修复从
    ~/.agents
    加载此Skill的代理;更新Skill才是实现可移植行为的正确方式。

Step 4 — Interpret the response

步骤4 — 解析响应

Parse the JSON output. Common response shapes:
json
{ "result": { "summary": "...", "popular": [...], "valued": [...] } }
  • summary
    non-null → use as the primary answer text
  • popular
    /
    valued
    arrays present → list the builds
  • All result fields null → service returned no data; tell the user and offer to answer from general knowledge instead
  • isError: true
    → report the error and suggest retry
解析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

边缘情况处理

SituationAction
list_tools
returns 0 tools
Report service unavailable; answer from training knowledge
Tool description is emptyInfer purpose from name + parameter names
Schema has no
required
Treat all params as optional; pass what you have
All response fields nullNo data for this query; say so and fall back to general knowledge
HTTP error on
list_tools
Report error; do not proceed to call step
HTTP error on
call
Retry once; if still failing, fall back to general knowledge
Multiple tools matchPick most specific; briefly note the choice

场景操作
list_tools
返回0个工具
报告服务不可用;使用训练知识回答
工具描述为空从工具名称+参数名称推断用途
架构无
required
字段
将所有参数视为可选;传递已有参数
所有响应字段为空无此查询的数据;告知用户并 fallback 到通用知识
list_tools
请求出现HTTP错误
报告错误;不进入调用步骤
call
请求出现HTTP错误
重试一次;若仍失败,fallback到通用知识
多个工具匹配选择最具体的工具;简要说明此选择

Script reference

脚本参考

scripts/mcp_client.py
uses Python standard library only (3.6+, no pip needed). Handles both
application/json
and
text/event-stream
responses automatically.
python 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 stdin
Errors go to stderr with a non-zero exit code. Invalid JSON prints a short hint for PowerShell users.
scripts/mcp_client.py
仅使用Python标准库(3.6+,无需pip安装)。可自动处理
application/json
text/event-stream
响应。
python 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用户打印简短提示。