用途:该技能用于浏览和获取 SCAPI(Salesforce B2C Commerce API)的 OpenAPI 契约,支持标准契约与租户专属契约。当需要列出可用 SCAPI API、查看端点路径或操作定义时可使用。
主要能力:通过 MCP 时,优先使用 scapi_search 查询 Admin 与 Shopper 契约,需先通过 resource 或 skills_read 读取 skill://mcp/b2c-mcp-scapi/SKILL.md 并传 skillRead: true;默认离线搜索内置标准契约,schemas: "live" 可搜索租户契约(自定义属性、自定义 API、较新 API)并在 scapi_execute 中调用。scapi_schemas_list 用于 live schema、自定义属性与自定义 API;查租户字段需提供 API family/name/version 并设 includeSchemas: true;自定义属性默认展开,expandAll: true 保留完整定义。scapi_custom_apis_get_status 查询注册状态。
CLI 用法:使用 b2c scapi schemas list 与 b2c scapi schemas get <family> <name> <version>;两者使用 live 访问,失败时回退到内置标准契约并给出警告(--json 中 source: "bundled")。Schemas API 仅在请求时返回操作摘要/描述与示例:--expand-paths/--expand-schemas 获取说明文本,--expand-all 获取全部,--include summaries,descriptions,... 选择所需段。CLI get 默认展开自定义属性,--no-expand-custom-properties 请求标准契约。MCP 同样默认展开,可用 expandCustomProperties: false 关闭。已知自定义字段可在标准 Admin code-mode 请求中直接发送,无需读取 schema 或离线刷新。config_inspect 是 b2c setup inspect 的脱敏 MCP 等价物。CLI 无 code-mode 等价物。若未全局安装 b2c,可用 npx @salesforce/b2c-cli(如 npx @salesforce/b2c-cli scapi schemas list)。
配置:tenantId、shortCode、clientId、clientSecret 等从 dw.json / SFCC_* 环境变量 / 活动实例 / 配置插件解析,通常无需显式传参。运行 b2c setup inspect 查看解析结果与来源(--json 便于脚本化,密钥默认脱敏)。
限制:live schema 访问需要 sfcc.scapi-schemas 权限;已注册 Shopper 与二进制执行不支持;自定义 Admin 端点需先通过 scapi.request 获取 live 契约再调用;契约语义与限制应参考文档工具。无法确定分类。