sino-bc-cli 1.3.3 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +54 -13
  2. package/dist/SKILL.md +30 -13
  3. package/dist/api-doc/README.md +9 -5
  4. package/dist/api-doc/icenter-mcp-strategy-dimension-facebook-ad-list.md +9 -3
  5. package/dist/api-doc/icenter-mcp-strategy-dimension-google-ad-list.md +170 -0
  6. package/dist/api-doc/icenter-mcp-strategy-dimension-tiktok-ad-list.md +172 -0
  7. package/dist/api-doc/icenter-mcp-strategy-metrics-facebook-ad-list.md +7 -4
  8. package/dist/api-doc/icenter-mcp-strategy-metrics-google-ad-list.md +201 -0
  9. package/dist/api-doc/icenter-mcp-strategy-metrics-tiktok-ad-list.md +204 -0
  10. package/dist/index.js +1 -33
  11. package/package.json +6 -3
  12. package/dist/commands/api-endpoint.command.d.ts +0 -58
  13. package/dist/commands/api-endpoint.command.js +0 -212
  14. package/dist/commands/api-endpoint.command.js.map +0 -1
  15. package/dist/commands/api-list.command.d.ts +0 -39
  16. package/dist/commands/api-list.command.js +0 -179
  17. package/dist/commands/api-list.command.js.map +0 -1
  18. package/dist/commands/bc-api.command.d.ts +0 -20
  19. package/dist/commands/bc-api.command.js +0 -30
  20. package/dist/commands/bc-api.command.js.map +0 -1
  21. package/dist/commands/ic-api.command.d.ts +0 -20
  22. package/dist/commands/ic-api.command.js +0 -30
  23. package/dist/commands/ic-api.command.js.map +0 -1
  24. package/dist/commands/index.d.ts +0 -12
  25. package/dist/commands/index.js +0 -29
  26. package/dist/commands/index.js.map +0 -1
  27. package/dist/commands/init.command.d.ts +0 -30
  28. package/dist/commands/init.command.js +0 -130
  29. package/dist/commands/init.command.js.map +0 -1
  30. package/dist/constants/api-catalog.d.ts +0 -34
  31. package/dist/constants/api-catalog.js +0 -118
  32. package/dist/constants/api-catalog.js.map +0 -1
  33. package/dist/constants/api-doc.d.ts +0 -13
  34. package/dist/constants/api-doc.js +0 -97
  35. package/dist/constants/api-doc.js.map +0 -1
  36. package/dist/constants/biz-line-api-doc.d.ts +0 -19
  37. package/dist/constants/biz-line-api-doc.js +0 -353
  38. package/dist/constants/biz-line-api-doc.js.map +0 -1
  39. package/dist/constants/gateway.d.ts +0 -36
  40. package/dist/constants/gateway.js +0 -119
  41. package/dist/constants/gateway.js.map +0 -1
  42. package/dist/constants/index.d.ts +0 -32
  43. package/dist/constants/index.js +0 -84
  44. package/dist/constants/index.js.map +0 -1
  45. package/dist/core/cli-app.d.ts +0 -51
  46. package/dist/core/cli-app.js +0 -283
  47. package/dist/core/cli-app.js.map +0 -1
  48. package/dist/core/command-registry.d.ts +0 -71
  49. package/dist/core/command-registry.js +0 -195
  50. package/dist/core/command-registry.js.map +0 -1
  51. package/dist/core/index.d.ts +0 -2
  52. package/dist/core/index.js +0 -9
  53. package/dist/core/index.js.map +0 -1
  54. package/dist/index.d.ts +0 -12
  55. package/dist/index.js.map +0 -1
  56. package/dist/types/index.d.ts +0 -122
  57. package/dist/types/index.js +0 -46
  58. package/dist/types/index.js.map +0 -1
  59. package/dist/utils/browser.d.ts +0 -52
  60. package/dist/utils/browser.js +0 -222
  61. package/dist/utils/browser.js.map +0 -1
  62. package/dist/utils/common.d.ts +0 -97
  63. package/dist/utils/common.js +0 -198
  64. package/dist/utils/common.js.map +0 -1
  65. package/dist/utils/crypto.d.ts +0 -53
  66. package/dist/utils/crypto.js +0 -153
  67. package/dist/utils/crypto.js.map +0 -1
  68. package/dist/utils/http.d.ts +0 -58
  69. package/dist/utils/http.js +0 -188
  70. package/dist/utils/http.js.map +0 -1
  71. package/dist/utils/index.d.ts +0 -7
  72. package/dist/utils/index.js +0 -22
  73. package/dist/utils/index.js.map +0 -1
  74. package/dist/utils/logger.d.ts +0 -56
  75. package/dist/utils/logger.js +0 -161
  76. package/dist/utils/logger.js.map +0 -1
  77. package/dist/utils/prompt.d.ts +0 -18
  78. package/dist/utils/prompt.js +0 -77
  79. package/dist/utils/prompt.js.map +0 -1
  80. package/dist/utils/skill-install.d.ts +0 -74
  81. package/dist/utils/skill-install.js +0 -131
  82. package/dist/utils/skill-install.js.map +0 -1
package/README.md CHANGED
@@ -140,11 +140,14 @@ sino-bc-cli/
140
140
  │ │
141
141
  │ ├── commands/ # 📦 命令实现层(每命令一个文件,可独立扩展)
142
142
  │ │ ├── index.ts # 命令批量注册入口
143
- │ │ ├── init.command.ts # /init 命令实现(注册 Agent 技能)
143
+ │ │ ├── init.command.ts # /init 命令实现(注册 Agent 技能 + 初始化变量配置)
144
144
  │ │ ├── api-list.command.ts # /api-list 命令实现(列出接口并打开文档)
145
145
  │ │ ├── api-endpoint.command.ts # 接口调用类命令基类(选择接口 → 发起调用 → 打印响应)
146
146
  │ │ ├── ic-api.command.ts # /ic-api 命令实现(调用 iCenter 接口地址)
147
- │ │ └── bc-api.command.ts # /bc-api 命令实现(调用业务线查询 / 业务线策略接口)
147
+ │ │ ├── bc-api.command.ts # /bc-api 命令实现(调用业务线查询 / 业务线策略接口)
148
+ │ │ ├── get-config.command.ts # /get-config 命令实现(查看变量配置)
149
+ │ │ ├── set-config.command.ts # /set-config 命令实现(修改变量配置)
150
+ │ │ └── uninstall.command.ts # /uninstall 命令实现(关闭 MCP、清理技能目录与配置并卸载)
148
151
  │ │
149
152
  │ ├── utils/ # 🛠 工具类层(高内聚的可复用工具)
150
153
  │ │ ├── index.ts # 工具模块统一导出
@@ -152,7 +155,12 @@ sino-bc-cli/
152
155
  │ │ ├── browser.ts # 浏览器工具(跨平台 URL 打开,兼容 Win/macOS/Linux)
153
156
  │ │ ├── crypto.ts # 加密工具(MD5、SHA-256、AES、Base64、签名生成)
154
157
  │ │ ├── http.ts # HTTP 工具(axios 封装:请求/响应拦截、自动重试)
155
- │ │ └── common.ts # 通用工具(日期、深拷贝、防抖节流、ID 生成等)
158
+ │ │ ├── common.ts # 通用工具(日期、深拷贝、防抖节流、ID 生成等)
159
+ │ │ ├── prompt.ts # 终端交互(复用单一 readline 会话:提问、选择、确认)
160
+ │ │ ├── config-store.ts # 变量配置读写(字段元信息 + 读 / 写 / 删)
161
+ │ │ ├── config-prompt.ts # 变量配置交互采集(/init 与 /set-config 共用)
162
+ │ │ ├── mcp-service.ts # MCP 服务启动 / 关闭(写入 Agent mcp.json + tools/call)
163
+ │ │ └── skill-install.ts # Agent 技能目录的写入与清理
156
164
  │ │
157
165
  │ ├── types/ # 📝 类型定义层
158
166
  │ │ └── index.ts # 全局接口、枚举定义(ICommand、LogLevel 等)
@@ -160,8 +168,8 @@ sino-bc-cli/
160
168
  │ └── constants/ # 🔧 常量配置层
161
169
  │ └── index.ts # CLI 配置、命令名称、默认值
162
170
  │
163
- ├── dist/ # 📤 编译输出目录(编译后自动生成)
164
- │ └── ... # JavaScript 编译产物 + 类型声明 + SourceMap
171
+ ├── dist/ # 📤 构建输出目录(构建后自动生成)
172
+ │ └── ... # 单文件混淆压缩产物 + SKILL.md + api-doc(不含 SourceMap)
165
173
  │
166
174
  ├── package.json # 📄 项目配置(依赖、脚本、bin 命令)
167
175
  ├── tsconfig.json # 📄 TypeScript 编译配置
@@ -280,10 +288,44 @@ sino-bc-cli /init
280
288
 
281
289
  | 命令 | 说明 |
282
290
  | :---------- | :-------------------------------------------------------------------------------------------- |
283
- | `/init` | 将本包 `SKILL.md` 复制到用户主目录下的 Agent 技能目录,供飞书豆包工作 / Cursor / Claude / Codex 自动识别 |
284
- | `/api-list` | 列出全部可调用接口;Cursor / VS Code 终端中 Ctrl+单击接口名或文档路径打开本地文档,也可输入序号或传入 name |
285
- | `/ic-api` | 交互选择并经网关调用 iCenter 接口(路径统一带 `/sino-icenter` 前缀);`ENV` 默认 `prod`,`API_KEY` 默认使用网关常量 |
286
- | `/bc-api` | 交互选择并调用业务线查询 / 业务线策略接口(共 22 个,路径统一带 `/sino-opti-hive` 前缀) |
291
+ | `/init` | 注册 `SKILL.md` 到 Agent 技能目录,并交互设置环境 / `X-GATEWAY-TYPE` / `API_KEY` / 是否走 MCP 写入变量配置文件 |
292
+ | `/api-list` | 列出全部可调用接口;Cursor / VS Code 终端中 Ctrl+单击接口名或文档路径打开本地文档,也可输入序号或传入 name |
293
+ | `/ic-api` | 交互选择并经网关调用 iCenter 接口(路径统一带 `/sino-icenter` 前缀);**不接收参数**,环境与鉴权取自变量配置文件 |
294
+ | `/bc-api` | 交互选择并调用业务线查询 / 业务线策略接口(共 22 个,路径统一带 `/sino-opti-hive` 前缀);**不接收参数** |
295
+ | `/get-config` | 查看变量配置文件内容;`API_KEY` 默认打码,`--show-secret` 显示明文,`--json` 输出 JSON |
296
+ | `/set-config` | 修改变量配置文件内容;不带参数时逐项交互修改 |
297
+ | `/uninstall` | 关闭 MCP 服务,删除 `/init` 创建的技能目录与变量配置文件,并从全局 npm 卸载本 CLI |
298
+
299
+ ### 变量配置文件
300
+
301
+ 环境、`X-GATEWAY-TYPE`、`API_KEY`、是否走 MCP 统一存放在 `<用户主目录>/.sino-bc-cli/config.json`,是这几项取值的唯一来源。
302
+
303
+ | 字段 | 命令行键名 | 默认值 | 说明 |
304
+ | :--- | :--------- | :----- | :--- |
305
+ | `env` | `env` | `prod` | 目标环境,可选 `test` / `pre` / `prod` |
306
+ | `gatewayType` | `gateway-type` | `A2C-CLI` | `X-GATEWAY-TYPE` 请求头取值 |
307
+ | `apiKey` | `api-key` | 内置默认 Key | 网关鉴权用的 API Key |
308
+ | `useMcp` | `use-mcp` | `no` | 是否走 MCP 服务调用接口,`yes` / `no`。为 `yes` 时,`/ic-api`、`/bc-api` 会先启动 MCP 再发请求 |
309
+ | `mcpToken` | `mcp-token` | 内置默认 Token | MCP 网关鉴权 Token;仅 `useMcp=yes` 时询问。过期会提示重输并写回配置文件 |
310
+
311
+ ```bash
312
+ # 查看(API_KEY 打码)
313
+ sino-bc-cli /get-config
314
+
315
+ # 三种修改写法等价
316
+ sino-bc-cli /set-config env test
317
+ sino-bc-cli /set-config env=test
318
+ sino-bc-cli /set-config --env=test
319
+
320
+ # 开启后会询问 MCP Token;/ic-api、/bc-api 会先启动 MCP 再发请求
321
+ sino-bc-cli /set-config use-mcp yes
322
+ sino-bc-cli /set-config mcp-token <新 token>
323
+
324
+ # 不带参数则逐项交互修改,直接回车保留当前值
325
+ sino-bc-cli /set-config
326
+ ```
327
+
328
+ > `/init` 在非交互环境(npm `postinstall`、CI、Agent 调用)下不会提问:配置文件不存在时按默认值创建,已存在时保持不变,因此重装或升级不会覆盖你设置好的环境与密钥。
287
329
 
288
330
  ### 全局选项
289
331
 
@@ -333,19 +375,18 @@ sino-bc-cli /api-list biz-line-open-list
333
375
 
334
376
  ```bash
335
377
  sino-bc-cli /ic-api
336
- sino-bc-cli /ic-api test
337
378
  ```
338
379
 
339
- 执行效果:交互选择接口后,向对应环境的网关地址发起请求。所有路径带 `/sino-icenter` 前缀。
380
+ 执行效果:交互选择接口后,向变量配置文件指定环境的网关地址发起请求。所有路径带 `/sino-icenter` 前缀。
381
+ 本命令不接收参数,切换环境请先执行 `sino-bc-cli /set-config env <test|pre|prod>`。
340
382
 
341
383
  #### ④ 调用业务线查询 / 业务线策略接口
342
384
 
343
385
  ```bash
344
386
  sino-bc-cli /bc-api
345
- sino-bc-cli /bc-api test
346
387
  ```
347
388
 
348
- 执行效果:按「业务线查询(5 个)」「业务线策略(17 个)」两组列出接口,输入序号后向对应环境网关发起请求。所有路径统一带 `/sino-opti-hive` 路由前缀,接口清单见 [`src/api-doc/README.md`](./src/api-doc/README.md)。
389
+ 执行效果:按「业务线查询(5 个)」「业务线策略(17 个)」两组列出接口,输入序号后向配置文件指定环境的网关发起请求。所有路径统一带 `/sino-opti-hive` 路由前缀,接口清单见 [`src/api-doc/README.md`](./src/api-doc/README.md)。
349
390
 
350
391
  > ⚠️ 业务线策略组含新建 / 编辑 / 删除等写操作接口,会按文档示例请求体直接发起调用,执行前请确认环境。
351
392
 
package/dist/SKILL.md CHANGED
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  name: sino-bc-cli
3
3
  description: >
4
- Use when 查询或操作 BeyondClick / iCenter / 业务线数据:Facebook 广告策略维度或成效、
4
+ Use when 查询或操作 BeyondClick / iCenter / 业务线数据:Facebook / Google / TikTok 广告策略维度或成效、
5
5
  投放渠道、投放品类、业务线列表/详情/策略与表现、Top 业务线、周策略增删改查、
6
6
  红绿灯、客户满意度、消耗、ROAS;或用户提到 sino-bc-cli、/init、/api-list、
7
- /ic-api、/bc-api、sino-icenter、sino-opti-hive、A2C-CLI。
7
+ /ic-api、/bc-api、/get-config、/set-config、/uninstall、sino-icenter、
8
+ sino-opti-hive、A2C-CLI。
8
9
  metadata:
9
10
  requires:
10
11
  bins: ["sino-bc-cli"]
@@ -16,7 +17,7 @@ BeyondClick 投放数据与业务线策略的 Agent 调用入口。用本 CLI
16
17
 
17
18
  ## When to Use
18
19
 
19
- - 查 Facebook(Meta)广告策略配置、消耗/点击/购买等成效
20
+ - 查 Facebook / Google / TikTok 广告策略配置、消耗/点击/购买等成效
20
21
  - 查投放渠道、投放行业/品类、业务线主数据、周策略与表现、行业 Top
21
22
  - 新建/编辑/删除业务线或周策略(须先确认环境和写操作意图)
22
23
  - 用户点名 `/api-list`、`/ic-api`、`/bc-api`、iCenter、sino-opti-hive
@@ -27,15 +28,21 @@ BeyondClick 投放数据与业务线策略的 Agent 调用入口。用本 CLI
27
28
 
28
29
  | 项 | 规则 |
29
30
  | --- | --- |
30
- | 环境 | `test` / `pre` / `prod`,未指明默认 `prod` |
31
+ | 环境 | `test` / `pre` / `prod`,取自变量配置文件,默认 `prod` |
31
32
  | 网关 | `https://test-agent.beyondclick.com`(当前三环境同一地址;所有请求只走网关,不直连服务地址) |
32
33
  | iCenter 前缀 | `/sino-icenter` |
33
34
  | 业务线前缀 | `/sino-opti-hive` |
34
- | 鉴权 | `Authorization: Bearer <API_KEY>`;用户未给 Key 时用 CLI 内置默认值 |
35
- | 来源头 | 必须带 `X-GATEWAY-TYPE: A2C-CLI` |
35
+ | 鉴权 | `Authorization: Bearer <API_KEY>`;取自变量配置文件,未设置时用 CLI 内置默认值 |
36
+ | 来源头 | 必须带 `X-GATEWAY-TYPE`,取自变量配置文件,默认 `A2C-CLI` |
36
37
  | 请求体 | 按用户条件组装;禁止原样提交文档示例账号/业务线 ID |
37
38
 
38
- `/ic-api`、`/bc-api` 会停在「请输入序号」,且只用文档默认 body。Agent 在非 TTY 下不要跑这两条;需要真实查询时直接 HTTP。
39
+ ### 变量配置文件
40
+
41
+ 环境、`X-GATEWAY-TYPE`、`API_KEY` 统一存放在 `<用户主目录>/.sino-bc-cli/config.json`,由 `/init` 创建、`/set-config` 修改。
42
+ 需要知道当前生效取值时执行 `sino-bc-cli /get-config --json`(`API_KEY` 默认打码,加 `--show-secret` 才是明文)。
43
+
44
+ `/ic-api`、`/bc-api` 不接收任何参数,且必须在交互式终端里选接口、只用文档默认 body。
45
+ Agent 在非 TTY 下跑这两条会直接报错退出;需要真实查询时用 `/api-list` 发现接口后直接 HTTP。
39
46
 
40
47
  ## Agent 流程
41
48
 
@@ -61,8 +68,12 @@ CLI 未安装:`npm i sino-bc-cli@latest -g`(需 Node.js >= 24)。技能未
61
68
 
62
69
  | 用户在问 | name | 注意 |
63
70
  | --- | --- | --- |
64
- | Facebook 广告策略配置(目标/出价/受众,不含消耗) | `icenter-mcp-strategy-dimension-facebook-ad-list` | `dimensionValues` 只能有 `account_id`;账户须 `act_` 前缀;`dimensions` 非空 |
65
- | 策略 + 成效(消耗、点击、购买等) | `icenter-mcp-strategy-metrics-facebook-ad-list` | 最多近 21 天;`indicators` 非空 |
71
+ | Facebook 广告策略配置(目标/出价/受众/创意,不含消耗) | `icenter-mcp-strategy-dimension-facebook-ad-list` | `dimensionValues` 只能有 `account_id`;账户须 `act_` 前缀;`dimensions` 非空;`country_code` 必须单独传 |
72
+ | Facebook 策略 + 成效(消耗、点击、购买等) | `icenter-mcp-strategy-metrics-facebook-ad-list` | 最多近 21 天;`indicators` 非空 |
73
+ | Google 广告策略配置(成效目标/出价/系列类型,不含消耗) | `icenter-mcp-strategy-dimension-google-ad-list` | 不支持广告目标和兴趣词包;出价用 `cpc_bid_amount` / `cpm_bid_amount` / `cpv_bid_amount`;`country_code` 必须单独传 |
74
+ | Google 策略 + 成效 | `icenter-mcp-strategy-metrics-google-ad-list` | 最多近 21 天;`indicators` 非空 |
75
+ | TikTok 广告策略配置(含转化出价/深度转化出价,不含消耗) | `icenter-mcp-strategy-dimension-tiktok-ad-list` | TikTok 独有 `conversion_bid` / `deep_cpabid`;`country_code` 必须单独传 |
76
+ | TikTok 策略 + 成效 | `icenter-mcp-strategy-metrics-tiktok-ad-list` | 最多近 21 天;`indicators` 非空 |
66
77
  | iCenter git 版本 | `icenter-mcp-version-query` | GET,无 body |
67
78
 
68
79
  ### 业务线查询(只读,文档 `biz-line-query.md`)
@@ -97,18 +108,24 @@ CLI 未安装:`npm i sino-bc-cli@latest -g`(需 Node.js >= 24)。技能未
97
108
  ```bash
98
109
  sino-bc-cli /api-list
99
110
  sino-bc-cli /api-list biz-line-open-list
100
- sino-bc-cli /ic-api test # 交互;默认文档示例 body
101
- sino-bc-cli /bc-api --env=prod
102
- sino-bc-cli /init
111
+ sino-bc-cli /ic-api # 交互选接口;不接收参数,用文档示例 body
112
+ sino-bc-cli /bc-api
113
+
114
+ sino-bc-cli /init # 注册技能 + 交互设置环境 / 网关头 / API_KEY
115
+ sino-bc-cli /get-config # 查看变量配置(API_KEY 打码)
116
+ sino-bc-cli /set-config env prod # 改单项;也支持 --env=prod、不带参数逐项交互
117
+ sino-bc-cli /uninstall # 清理技能目录与配置文件并卸载 CLI
103
118
  ```
104
119
 
105
120
  ## Common Mistakes
106
121
 
107
122
  | 错误 | 正确做法 |
108
123
  | --- | --- |
109
- | 非 TTY 执行 `/ic-api`、`/bc-api` 卡住 | 直接 HTTP;只用 `/api-list` 发现接口 |
124
+ | 非 TTY 执行 `/ic-api`、`/bc-api` | 这两条会报错退出;改直接 HTTP,只用 `/api-list` 发现接口 |
125
+ | 给 `/ic-api`、`/bc-api` 传环境或 Key | 参数已下线;用 `/set-config` 改、`/get-config` 查 |
110
126
  | 用文档里的 `act_…` / `bizLineId: 1251` | 换成用户给出的账户或业务线 |
111
127
  | 成效接口一次查超过 21 天 | 拆段或改查维度接口 |
128
+ | 把 `country_code` 和其他维度一起传 | 国家维度必须单独查,不能和其他维度同时传入 |
112
129
  | 漏 `X-GATEWAY-TYPE` 或路径前缀 | 带 `A2C-CLI`;iCenter / 业务线分别加对应前缀 |
113
130
  | 直连 `o-test-tc-sino-icenter` / `o-test-sino-opti-hive` 等服务地址 | 一律请求网关 `https://test-agent.beyondclick.com` + 路由前缀 |
114
131
  | 未确认就调 save/update/del | 先确认环境与写操作 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  | 分组 | 命令 | 接口数 | 文档 |
6
6
  | --- | --- | --- | --- |
7
- | iCenter MCP | `/ic-api` | 3 | 见下方「iCenter MCP 接口」 |
7
+ | iCenter MCP | `/ic-api` | 7 | 见下方「iCenter MCP 接口」 |
8
8
  | 业务线查询 | `/bc-api` | 5 | [biz-line-query.md](./biz-line-query.md) |
9
9
  | 业务线策略 | `/bc-api` | 17 | [biz-line-strategy.md](./biz-line-strategy.md) |
10
10
 
@@ -26,14 +26,18 @@
26
26
 
27
27
  ## iCenter MCP 接口
28
28
 
29
- 数据来源:[ContextForge MCP Gateway Admin - Tools](https://o-test-sino-mcp-gateway.meetsocial.cn/admin/?tools_page=2&tools_size=10&tools_inactive=false#tools)
29
+ 数据来源:[ContextForge MCP Gateway Admin - Tools](https://o-test-sino-mcp-gateway.meetsocial.cn/admin/?team_id=61761abbe4a4476c84c7df2cd7335a52#tools)
30
30
 
31
- 筛选规则:`name` 以 `icenter-mcp-` 开头。当前共 **3** 个接口,每个接口一份独立文档。所有路径经网关调用时统一带 `/sino-icenter` 路由前缀,例如 `/sino-icenter/version`。
31
+ 筛选规则:`name` 以 `icenter-mcp-` 开头。当前共 **7** 个接口,每个接口一份独立文档。所有路径经网关调用时统一带 `/sino-icenter` 路由前缀,例如 `/sino-icenter/version`。
32
32
 
33
33
  | 文档 | name | 展示名 | 方法 | 说明 |
34
34
  | --- | --- | --- | --- | --- |
35
- | [icenter-mcp-strategy-dimension-facebook-ad-list.md](./icenter-mcp-strategy-dimension-facebook-ad-list.md) | `icenter-mcp-strategy-dimension-facebook-ad-list` | Facebook广告策略维度数据 | POST | 查询广告策略配置(不含成效指标) |
36
- | [icenter-mcp-strategy-metrics-facebook-ad-list.md](./icenter-mcp-strategy-metrics-facebook-ad-list.md) | `icenter-mcp-strategy-metrics-facebook-ad-list` | Facebook广告策略成效数据 | POST | 查询策略维度 + 成效指标(最多近 21 天) |
35
+ | [icenter-mcp-strategy-dimension-facebook-ad-list.md](./icenter-mcp-strategy-dimension-facebook-ad-list.md) | `icenter-mcp-strategy-dimension-facebook-ad-list` | Facebook广告策略维度数据 | POST | 查询 Facebook 广告策略配置(不含成效指标) |
36
+ | [icenter-mcp-strategy-metrics-facebook-ad-list.md](./icenter-mcp-strategy-metrics-facebook-ad-list.md) | `icenter-mcp-strategy-metrics-facebook-ad-list` | Facebook广告策略成效数据 | POST | 查询 Facebook 策略维度 + 成效指标(最多近 21 天) |
37
+ | [icenter-mcp-strategy-dimension-google-ad-list.md](./icenter-mcp-strategy-dimension-google-ad-list.md) | `icenter-mcp-strategy-dimension-google-ad-list` | Google广告策略维度数据 | POST | 查询 Google 广告策略配置(不含成效指标) |
38
+ | [icenter-mcp-strategy-metrics-google-ad-list.md](./icenter-mcp-strategy-metrics-google-ad-list.md) | `icenter-mcp-strategy-metrics-google-ad-list` | Google广告策略成效数据 | POST | 查询 Google 策略维度 + 成效指标(最多近 21 天) |
39
+ | [icenter-mcp-strategy-dimension-tiktok-ad-list.md](./icenter-mcp-strategy-dimension-tiktok-ad-list.md) | `icenter-mcp-strategy-dimension-tiktok-ad-list` | TikTok广告策略维度数据 | POST | 查询 TikTok 广告策略配置(不含成效指标) |
40
+ | [icenter-mcp-strategy-metrics-tiktok-ad-list.md](./icenter-mcp-strategy-metrics-tiktok-ad-list.md) | `icenter-mcp-strategy-metrics-tiktok-ad-list` | TikTok广告策略成效数据 | POST | 查询 TikTok 策略维度 + 成效指标(最多近 21 天) |
37
41
  | [icenter-mcp-version-query.md](./icenter-mcp-version-query.md) | `icenter-mcp-version-query` | 查询git最新提交版本 | GET | 查询 iCenter 服务 git 最新提交版本 |
38
42
 
39
43
  对应命令:`/ic-api`,接口清单定义在 `src/constants/api-doc.ts`。
@@ -21,10 +21,12 @@ https://test-agent.beyondclick.com/sino-icenter/mcp/strategy/dimension/facebook/
21
21
 
22
22
  ## 说明
23
23
 
24
- 查询 Facebook(Meta)渠道的广告策略配置数据。按指定广告账户和日期范围,返回广告的策略设置明细(广告目标、成效目标、出价方式、调整出价、受众类型、兴趣词包、年龄、性别等),用于分析某批账户在某段时间内各广告的策略配置分布。
24
+ 查询 Facebook(Meta)渠道的广告策略配置数据。按指定广告账户和日期范围,返回广告的策略设置明细(广告目标、成效目标、创意类型、出价方式、调整出价、受众类型、兴趣词包、年龄、性别等),用于分析某批账户在某段时间内各广告的策略配置分布。
25
25
 
26
26
  本接口**只返回策略维度**,不含消耗、点击等成效指标。需要成效数据请改用 [`icenter-mcp-strategy-metrics-facebook-ad-list`](./icenter-mcp-strategy-metrics-facebook-ad-list.md)。
27
27
 
28
+ **国家维度特别说明**:`country_code` 必须单独传入,不能和任何其他维度同时传,否则会报错「country_code 不能和其他维度同时传入」。查国家维度时服务端会转走跨渠道广告数据接口,只返回按国家分组的数据。
29
+
28
30
  ## 请求头
29
31
 
30
32
  | Header | 值 |
@@ -68,15 +70,15 @@ https://test-agent.beyondclick.com/sino-icenter/mcp/strategy/dimension/facebook/
68
70
  | bid_amount | 调整出价 |
69
71
  | objective | 广告目标 |
70
72
  | optimization_goal | 成效目标 |
73
+ | ad_format | 创意类型 |
71
74
  | bid_strategy | 出价方式 |
72
75
  | audience_type | 受众类型 |
73
- | targeting_geo_countries | 定向国家 |
74
- | targeting_geo_country_groups | 定向国家分组 |
75
76
  | targeting_interests | 兴趣词包 |
76
77
  | targeting_flexible_interests | 弹性兴趣词包 |
77
78
  | targeting_exclusion_interests | 排除兴趣词包 |
78
79
  | targeting_age | 年龄 |
79
80
  | targeting_genders | 性别 |
81
+ | country_code | 国家(必须单独传,不能和其他维度同时传) |
80
82
 
81
83
  ## 返回格式
82
84
 
@@ -102,6 +104,7 @@ https://test-agent.beyondclick.com/sino-icenter/mcp/strategy/dimension/facebook/
102
104
  "ad_name",
103
105
  "objective",
104
106
  "optimization_goal",
107
+ "ad_format",
105
108
  "bid_strategy",
106
109
  "audience_type"
107
110
  ],
@@ -128,6 +131,7 @@ https://test-agent.beyondclick.com/sino-icenter/mcp/strategy/dimension/facebook/
128
131
  "ad_name": "广告名称",
129
132
  "objective": "广告目标",
130
133
  "optimization_goal": "成效目标",
134
+ "ad_format": "创意类型",
131
135
  "bid_strategy": "出价方式",
132
136
  "audience_type": "受众类型"
133
137
  },
@@ -143,6 +147,8 @@ https://test-agent.beyondclick.com/sino-icenter/mcp/strategy/dimension/facebook/
143
147
  "display_objective": "转化",
144
148
  "optimization_goal": "OFFSITE_CONVERSIONS",
145
149
  "display_optimization_goal": "网站转化",
150
+ "ad_format": "SINGLE_IMAGE",
151
+ "display_ad_format": "单图",
146
152
  "bid_strategy": "LOWEST_COST_WITHOUT_CAP",
147
153
  "display_bid_strategy": "最低成本",
148
154
  "audience_type": "INTEREST",
@@ -0,0 +1,170 @@
1
+ # Google广告策略维度数据
2
+
3
+ - **name**:`icenter-mcp-strategy-dimension-google-ad-list`
4
+ - **displayName**:Google广告策略维度数据
5
+ - **Tool ID**:`8d4fbfda08ea40d2b789ba9b334106af`
6
+ - **请求方法**:`POST`
7
+ - **集成类型**:REST
8
+ - **超时**:20000 ms
9
+ - **状态**:Online / Public / enabled
10
+
11
+ ## 接口地址
12
+
13
+ ```
14
+ https://test-agent.beyondclick.com/sino-icenter/mcp/strategy/dimension/google/ad/list
15
+ ```
16
+
17
+ - **baseUrl**:`https://test-agent.beyondclick.com`(网关地址,三环境同一地址,唯一来源 `src/constants/gateway.ts` 的 `GATEWAY_CONFIG`)
18
+ - **path**:`/sino-icenter/mcp/strategy/dimension/google/ad/list`
19
+
20
+ > 一律经网关调用,不要直连 iCenter 服务地址。
21
+
22
+ ## 说明
23
+
24
+ 查询 Google 渠道的广告策略配置数据。按指定广告账户和日期范围,返回广告的策略设置明细(成效目标、创意类型、出价方式、CPC/CPM/CPV 出价、广告系列类型、关键字等),用于分析某批账户在某段时间内各广告的策略配置分布。
25
+
26
+ Google 渠道**不支持广告目标和兴趣词包维度**,出价字段使用 `cpc_bid_amount`、`cpm_bid_amount`、`cpv_bid_amount` 三个独立维度。
27
+
28
+ 本接口**只返回策略维度**,不含消耗、点击等成效指标。需要成效数据请改用 [`icenter-mcp-strategy-metrics-google-ad-list`](./icenter-mcp-strategy-metrics-google-ad-list.md)。
29
+
30
+ **国家维度特别说明**:`country_code` 必须单独传入,不能和任何其他维度同时传,否则会报错「country_code 不能和其他维度同时传入」。查国家维度时服务端会转走跨渠道广告数据接口,只返回按国家分组的数据。
31
+
32
+ ## 请求头
33
+
34
+ | Header | 值 |
35
+ | --- | --- |
36
+ | Content-Type | `application/json` |
37
+
38
+ ## 请求参数
39
+
40
+ 请求体为 JSON object。
41
+
42
+ | 字段 | 类型 | 必填 | 默认值 | 说明 |
43
+ | --- | --- | --- | --- | --- |
44
+ | startDate | string | 是 | — | 开始日期,格式 `yyyy-MM-dd`,例如 `2026-08-01` |
45
+ | endDate | string | 是 | — | 结束日期,格式 `yyyy-MM-dd`,例如 `2026-08-31` |
46
+ | dimensionValues | object | 是 | — | 过滤条件,**仅支持 `account_id` 一个 key**,传其他 key 会报错 |
47
+ | dimensions | string[] | 是 | — | 分组维度,必传且**不能为空数组**,否则返回结果为空 |
48
+ | order | string | 否 | — | 排序字段,填单个维度 code,取值范围为 `dimensions` 的可选值。不必包含在已传的 `dimensions` 中,服务端会自动补入参与排序,但该字段不会作为列返回 |
49
+ | orderType | string | 否 | `asc` | 排序方向:`desc` / `asc` |
50
+ | page | integer | 否 | `1` | 页码,从 1 开始 |
51
+ | size | integer | 否 | `10` | 每页条数,建议显式传且不超过 1000 |
52
+
53
+ ### dimensionValues
54
+
55
+ | 字段 | 类型 | 必填 | 说明 |
56
+ | --- | --- | --- | --- |
57
+ | account_id | string[] | 是 | 广告账户 ID(带格式),必须带前缀,例如 `act_1036928420879324`。最多传 500 个 |
58
+
59
+ ### dimensions 可选值
60
+
61
+ | code | 含义 |
62
+ | --- | --- |
63
+ | calendar_date | 投放日期 |
64
+ | account_id | 广告账户 |
65
+ | account_name | 账户名称 |
66
+ | campaign_id | 广告系列 ID |
67
+ | campaign_name | 广告系列名称 |
68
+ | adgroup_id | 广告组 ID |
69
+ | adgroup_name | 广告组名称 |
70
+ | ad_id | 广告 ID |
71
+ | ad_name | 广告名称 |
72
+ | optimization_goal | 成效目标 |
73
+ | ad_format | 创意类型 |
74
+ | bid_strategy | 出价方式 |
75
+ | audience_type | 受众类型 |
76
+ | targeting_age | 年龄 |
77
+ | targeting_genders | 性别 |
78
+ | cpc_bid_amount | CPC 出价 |
79
+ | cpm_bid_amount | CPM 出价 |
80
+ | cpv_bid_amount | CPV 出价 |
81
+ | advertising_channel_type | 广告系列类型 |
82
+ | keywords | 关键字 |
83
+ | country_code | 国家(必须单独传,不能和其他维度同时传) |
84
+
85
+ > Google 渠道**不含** `objective`(广告目标)、`targeting_interests`(兴趣词包)。
86
+
87
+ ## 返回格式
88
+
89
+ - `result.data` 为数据行数组,每行的每个字段有两个 key:
90
+ - **原始值**:key 即请求的 code,做计算或比较时用这个
91
+ - **展示值**:key 加 `display_` 前缀,直接呈现给用户时用这个,空值为 `"-"`
92
+ - `result.headerMap` 是字段 code 到中文列名的映射,用于给用户展示列名
93
+ - `result.total` 为总条数,`result.page` 和 `result.size` 为当前分页
94
+ - 外层 `code=0` 表示成功;非 0 时 `result` 为 `null`,失败原因在 `message` 字段里
95
+
96
+ ## 请求示例
97
+
98
+ ```json
99
+ {
100
+ "startDate": "2026-08-01",
101
+ "endDate": "2026-08-31",
102
+ "dimensionValues": {
103
+ "account_id": ["act_1036928420879324"]
104
+ },
105
+ "dimensions": [
106
+ "account_id",
107
+ "ad_id",
108
+ "ad_name",
109
+ "optimization_goal",
110
+ "ad_format",
111
+ "bid_strategy",
112
+ "advertising_channel_type"
113
+ ],
114
+ "order": "ad_id",
115
+ "orderType": "asc",
116
+ "page": 1,
117
+ "size": 20
118
+ }
119
+ ```
120
+
121
+ ## 成功响应示例
122
+
123
+ ```json
124
+ {
125
+ "code": 0,
126
+ "message": "success",
127
+ "result": {
128
+ "page": 1,
129
+ "size": 20,
130
+ "total": 1,
131
+ "headerMap": {
132
+ "account_id": "广告账户",
133
+ "ad_id": "广告ID",
134
+ "ad_name": "广告名称",
135
+ "optimization_goal": "成效目标",
136
+ "ad_format": "创意类型",
137
+ "bid_strategy": "出价方式",
138
+ "advertising_channel_type": "广告系列类型"
139
+ },
140
+ "data": [
141
+ {
142
+ "account_id": "act_1036928420879324",
143
+ "display_account_id": "act_1036928420879324",
144
+ "ad_id": "120210000000000001",
145
+ "display_ad_id": "120210000000000001",
146
+ "ad_name": "示例广告",
147
+ "display_ad_name": "示例广告",
148
+ "optimization_goal": "CONVERSIONS",
149
+ "display_optimization_goal": "转化",
150
+ "ad_format": "RESPONSIVE_SEARCH_AD",
151
+ "display_ad_format": "自适应搜索广告",
152
+ "bid_strategy": "TARGET_CPA",
153
+ "display_bid_strategy": "目标 CPA",
154
+ "advertising_channel_type": "SEARCH",
155
+ "display_advertising_channel_type": "搜索"
156
+ }
157
+ ]
158
+ }
159
+ }
160
+ ```
161
+
162
+ ## 失败响应示例
163
+
164
+ ```json
165
+ {
166
+ "code": 1,
167
+ "message": "country_code 不能和其他维度同时传入",
168
+ "result": null
169
+ }
170
+ ```
@@ -0,0 +1,172 @@
1
+ # TikTok广告策略维度数据
2
+
3
+ - **name**:`icenter-mcp-strategy-dimension-tiktok-ad-list`
4
+ - **displayName**:TikTok广告策略维度数据
5
+ - **Tool ID**:`277feb43274646ad9fed802d6de50a87`
6
+ - **请求方法**:`POST`
7
+ - **集成类型**:REST
8
+ - **超时**:20000 ms
9
+ - **状态**:Online / Public / enabled
10
+
11
+ ## 接口地址
12
+
13
+ ```
14
+ https://test-agent.beyondclick.com/sino-icenter/mcp/strategy/dimension/tiktok/ad/list
15
+ ```
16
+
17
+ - **baseUrl**:`https://test-agent.beyondclick.com`(网关地址,三环境同一地址,唯一来源 `src/constants/gateway.ts` 的 `GATEWAY_CONFIG`)
18
+ - **path**:`/sino-icenter/mcp/strategy/dimension/tiktok/ad/list`
19
+
20
+ > 一律经网关调用,不要直连 iCenter 服务地址。
21
+
22
+ ## 说明
23
+
24
+ 查询 TikTok 渠道的广告策略配置数据。按指定广告账户和日期范围,返回广告的策略设置明细(广告目标、成效目标、创意类型、出价方式、调整出价、转化出价、深度转化出价、兴趣词包、年龄、性别等),用于分析某批账户在某段时间内各广告的策略配置分布。
25
+
26
+ 转化出价(`conversion_bid`)和深度转化出价(`deep_cpabid`)是 TikTok 渠道独有的维度。
27
+
28
+ 本接口**只返回策略维度**,不含消耗、点击等成效指标。需要成效数据请改用 [`icenter-mcp-strategy-metrics-tiktok-ad-list`](./icenter-mcp-strategy-metrics-tiktok-ad-list.md)。
29
+
30
+ **国家维度特别说明**:`country_code` 必须单独传入,不能和任何其他维度同时传,否则会报错「country_code 不能和其他维度同时传入」。查国家维度时服务端会转走跨渠道广告数据接口,只返回按国家分组的数据。
31
+
32
+ ## 请求头
33
+
34
+ | Header | 值 |
35
+ | --- | --- |
36
+ | Content-Type | `application/json` |
37
+
38
+ ## 请求参数
39
+
40
+ 请求体为 JSON object。
41
+
42
+ | 字段 | 类型 | 必填 | 默认值 | 说明 |
43
+ | --- | --- | --- | --- | --- |
44
+ | startDate | string | 是 | — | 开始日期,格式 `yyyy-MM-dd`,例如 `2026-08-01` |
45
+ | endDate | string | 是 | — | 结束日期,格式 `yyyy-MM-dd`,例如 `2026-08-31` |
46
+ | dimensionValues | object | 是 | — | 过滤条件,**仅支持 `account_id` 一个 key**,传其他 key 会报错 |
47
+ | dimensions | string[] | 是 | — | 分组维度,必传且**不能为空数组**,否则返回结果为空 |
48
+ | order | string | 否 | — | 排序字段,填单个维度 code,取值范围为 `dimensions` 的可选值。不必包含在已传的 `dimensions` 中,服务端会自动补入参与排序,但该字段不会作为列返回 |
49
+ | orderType | string | 否 | `asc` | 排序方向:`desc` / `asc` |
50
+ | page | integer | 否 | `1` | 页码,从 1 开始 |
51
+ | size | integer | 否 | `10` | 每页条数,建议显式传且不超过 1000 |
52
+
53
+ ### dimensionValues
54
+
55
+ | 字段 | 类型 | 必填 | 说明 |
56
+ | --- | --- | --- | --- |
57
+ | account_id | string[] | 是 | 广告账户 ID(带格式),必须带前缀,例如 `act_1036928420879324`。最多传 500 个 |
58
+
59
+ ### dimensions 可选值
60
+
61
+ | code | 含义 |
62
+ | --- | --- |
63
+ | calendar_date | 投放日期 |
64
+ | account_id | 广告账户 |
65
+ | account_name | 账户名称 |
66
+ | campaign_id | 广告系列 ID |
67
+ | campaign_name | 广告系列名称 |
68
+ | adgroup_id | 广告组 ID |
69
+ | adgroup_name | 广告组名称 |
70
+ | ad_id | 广告 ID |
71
+ | ad_name | 广告名称 |
72
+ | bid_amount | 调整出价 |
73
+ | objective | 广告目标 |
74
+ | optimization_goal | 成效目标 |
75
+ | ad_format | 创意类型 |
76
+ | bid_strategy | 出价方式 |
77
+ | audience_type | 受众类型 |
78
+ | targeting_interests | 兴趣词包 |
79
+ | targeting_age | 年龄 |
80
+ | targeting_genders | 性别 |
81
+ | conversion_bid | 转化出价 |
82
+ | deep_cpabid | 深度转化出价 |
83
+ | country_code | 国家(必须单独传,不能和其他维度同时传) |
84
+
85
+ ## 返回格式
86
+
87
+ - `result.data` 为数据行数组,每行的每个字段有两个 key:
88
+ - **原始值**:key 即请求的 code,做计算或比较时用这个
89
+ - **展示值**:key 加 `display_` 前缀,直接呈现给用户时用这个,空值为 `"-"`
90
+ - `result.headerMap` 是字段 code 到中文列名的映射,用于给用户展示列名
91
+ - `result.total` 为总条数,`result.page` 和 `result.size` 为当前分页
92
+ - 外层 `code=0` 表示成功;非 0 时 `result` 为 `null`,失败原因在 `message` 字段里
93
+
94
+ ## 请求示例
95
+
96
+ ```json
97
+ {
98
+ "startDate": "2026-08-01",
99
+ "endDate": "2026-08-31",
100
+ "dimensionValues": {
101
+ "account_id": ["act_1036928420879324"]
102
+ },
103
+ "dimensions": [
104
+ "account_id",
105
+ "ad_id",
106
+ "ad_name",
107
+ "objective",
108
+ "optimization_goal",
109
+ "ad_format",
110
+ "bid_strategy",
111
+ "conversion_bid"
112
+ ],
113
+ "order": "ad_id",
114
+ "orderType": "asc",
115
+ "page": 1,
116
+ "size": 20
117
+ }
118
+ ```
119
+
120
+ ## 成功响应示例
121
+
122
+ ```json
123
+ {
124
+ "code": 0,
125
+ "message": "success",
126
+ "result": {
127
+ "page": 1,
128
+ "size": 20,
129
+ "total": 1,
130
+ "headerMap": {
131
+ "account_id": "广告账户",
132
+ "ad_id": "广告ID",
133
+ "ad_name": "广告名称",
134
+ "objective": "广告目标",
135
+ "optimization_goal": "成效目标",
136
+ "ad_format": "创意类型",
137
+ "bid_strategy": "出价方式",
138
+ "conversion_bid": "转化出价"
139
+ },
140
+ "data": [
141
+ {
142
+ "account_id": "act_1036928420879324",
143
+ "display_account_id": "act_1036928420879324",
144
+ "ad_id": "120210000000000001",
145
+ "display_ad_id": "120210000000000001",
146
+ "ad_name": "示例广告",
147
+ "display_ad_name": "示例广告",
148
+ "objective": "CONVERSIONS",
149
+ "display_objective": "转化",
150
+ "optimization_goal": "CONVERT",
151
+ "display_optimization_goal": "转化",
152
+ "ad_format": "SINGLE_VIDEO",
153
+ "display_ad_format": "单视频",
154
+ "bid_strategy": "BID_TYPE_CUSTOM",
155
+ "display_bid_strategy": "自定义出价",
156
+ "conversion_bid": "12.5",
157
+ "display_conversion_bid": "12.5"
158
+ }
159
+ ]
160
+ }
161
+ }
162
+ ```
163
+
164
+ ## 失败响应示例
165
+
166
+ ```json
167
+ {
168
+ "code": 1,
169
+ "message": "country_code 不能和其他维度同时传入",
170
+ "result": null
171
+ }
172
+ ```