@mambasms/mcp-server 0.7.24 → 0.7.26
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.
- package/index.js +181 -22
- package/package.json +1 -1
- package/skill/mambasms-mcp/SKILL.md +1 -1
- package/skill/mambasms-mcp/modules/audiences.md +12 -0
- package/skill/mambasms-mcp/modules/campaigns.md +0 -3
- package/skill/mambasms-mcp/modules/reports.md +5 -0
- package/skill/mambasms-mcp/references/tool-catalog.md +0 -1
package/index.js
CHANGED
|
@@ -100,6 +100,10 @@ const WRITE_TOOLS = new Set([
|
|
|
100
100
|
"flow_create",
|
|
101
101
|
"flow_update_content",
|
|
102
102
|
"user_group_create",
|
|
103
|
+
"blacklist_add",
|
|
104
|
+
"contact_subscription",
|
|
105
|
+
"contact_tag_add",
|
|
106
|
+
"contact_tag_remove",
|
|
103
107
|
]);
|
|
104
108
|
|
|
105
109
|
const TOOL_REGISTRY = new Map();
|
|
@@ -123,17 +127,17 @@ function defineTool(name, description, shape, handler) {
|
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
const server = new McpServer(
|
|
126
|
-
{ name: "mambasms-mcp-server", version: "0.7.
|
|
130
|
+
{ name: "mambasms-mcp-server", version: "0.7.26" },
|
|
127
131
|
{
|
|
128
|
-
instructions: `MambaSMS 营销自动化(店铺级,鉴权用 MAMBA_ACCESS_TOKEN 店铺密钥)。共
|
|
132
|
+
instructions: `MambaSMS 营销自动化(店铺级,鉴权用 MAMBA_ACCESS_TOKEN 店铺密钥)。共 73 个工具,分四组。
|
|
129
133
|
不确定用什么/想先看总览 → mamba_guide;只知道关键词 → mamba_search;要参数细节 → mamba_tool_schema。
|
|
130
134
|
|
|
131
135
|
【模板(17)】四条创建路径:A) template_create_from_design —— 首选,传结构化 emailDesign(style/theme/hero/intro/products/offer/cta/social),写前先 catalog_query(topic=emailDesign);要骨架传 catalog_query(topic=layouts);套已有模板传 templateId。B) template_create(html) —— 组件模板里嵌 HTML 区块/迁移现成 HTML(**模板只有组件形态**;客户要富文本(含整份HTML,默认)→建活动草稿 campaign_create_email(html=...))。C) template_create(sections) —— 动态区块(购物车/浏览列表),发送时填该联系人的数据。D) template_import —— mambatpl 或 zipHtml。参考面:template_list_system/template_get_system、block_library_query、catalog_query、template_snippets(页头页脚片段,社交图标走 link.mambasms.com/dynamicImage/{platform}/{size}/{shape}/{color},key 大小写敏感)。效果:template_preview(免登永久链接)、template_send_test。图片用 upload_image 转存 CDN。退订必须 {Unsubscribe}。
|
|
132
136
|
【先确认再动手】客户说「做个模板」「建封邮件」只说明用途,**不代表已选形式**(系统里的"模板"只有组件形态,客户嘴里的"模板"常常只是"做封邮件");第一次做邮件必须先用一句话问清形式,**只两种**:A. 富文本(默认,含 HTML 源码——简单排版或整份 HTML 都可;产物是**活动草稿** edition=richtext,后台富文本/HTML 编辑器能改);B. 组件(平台模板或从零生成组件,后台可拖拽微调,能存成模板、能给自动化流程用)。客户没说清或说"随便/你决定"→默认 A 富文本;客户说"模板"也要问(他可能是想要 HTML/富文本式的成品,那要建成活动草稿)。注意:内容是**你(AI)产出**,不要向客户索要 HTML;只需让客户选形式。【社媒与页脚】社媒入口**不要自己发明**:优先套系统模板(template_list_system→template_get_system→传 templateId),模板自带页脚社媒图标+退订;手写 HTML 或骨架时,社媒必须用 template_snippets(type=footer-social) 的片段(平台图标直链),放在**最底部(退订上方)**;**常用平台要默认给齐 10 个**(instagram/facebook/tiktok/youTube/twitter/pinterest/linkedIn/snapchat/whatsapp/reddit,图标服务全部支持),客户只给了部分账号时按他给的来、href 用真实主页,没给链接就先指向 {SiteUrl} 并在交付说明里提示可替换;禁止用文字按钮充当社媒入口,也不要在正文中部放社媒区。emailDesign 的 social 字段可省略(页脚社媒由模板/骨架生成)。
|
|
133
137
|
【分页有边界】列表类接口一律带 page/page_size:默认 page_size=20,建议≤50,上限100(模板列表≤500但建议50);禁止"循环翻页拉全量"(通常只取第一页/前50条够用),先用 keyword/status/时间窗/条件收窄再取;看汇总用报表接口(order_stats/campaign_report/flow_report),不要拉明细自己算;分组成员抽样看 20~50 人即可,不要枚举全组。
|
|
134
|
-
【只读/质检(
|
|
135
|
-
|
|
136
|
-
【通用(4)】mamba_guide 总览、mamba_search 搜索、mamba_tool_schema 查参数、mamba_execute 按名执行。MAMBA_READONLY=1 时只注册只读工具(
|
|
138
|
+
【只读/质检(40)】活动 campaign_*、流程 flow_*、分组 group_*/tag_list、联系人 contact_get/contact_search/contact_send_status、报表 audience_growth/form_performance/domain_health/store_overview/order_stats/account_balance、表单 form_list/form_report/form_fields/form_submissions、商品 product_list/product_get、订单 order_detail/order_list、黑名单 blacklist_list/audience_unsubscribed、商品系列 collection_list、模板引用 template_usage、折扣 discount_list、扣费 balance_log、用户统计 audience_stats、报告卡片 report_cards、质检 email_audit。列表统一 page/page_size(≤100,默认 20);报表默认近 180 天,可传 start_date/end_date 覆盖;订单已排除 CANCELLED;余额单位为美元且是 group 级(同集团多店共享);联系人支持精确查(contact_get)与模糊搜索(contact_search:关键词≥2字符、每页≤50、结果多时改用分组)。
|
|
139
|
+
【写(12)】campaign_create_email/sms/abtest/smsabtest、campaign_update_content、flow_create、flow_update_content、user_group_create、blacklist_add、contact_subscription、contact_tag_add/contact_tag_remove。一律 draft:不发送、不启用、不扣费;update 仅 draft 可改(否则 412);建分组前必须先 group_catalog 取真源(否则拒绝),且 user_group_create 必须把**客户原话**放进 intent(否则语义护栏不生效,否定/退订这类最容易错);活动指定人群用 communication_select=tag + tag_id。正文质量闸门:活动渲染后 ≥4200 字符、流程邮件节点 ≥3000 字符、须含 {Unsubscribe}、买家可见文案英文。
|
|
140
|
+
【通用(4)】mamba_guide 总览、mamba_search 搜索、mamba_tool_schema 查参数、mamba_execute 按名执行。MAMBA_READONLY=1 时只注册只读工具(73→53)。
|
|
137
141
|
明确不做:发送/启用/中断发送、删除活动、联系人模糊全表搜、拖拽式精修(留给后台)。
|
|
138
142
|
${PLACEHOLDER_GUIDE}`,
|
|
139
143
|
}
|
|
@@ -164,12 +168,18 @@ defineTool(
|
|
|
164
168
|
// 预览是"变量替换后的渲染",但部分变量(联系人邮箱/评价链接等)无上下文时会保留原占位符;
|
|
165
169
|
// 不说明的话 AI 会以为模板写错了,或者把占位符当正文再回写
|
|
166
170
|
try {
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
// /template/details 返回的是数组,逐个补提示(之前只处理对象,导致提示永远不出现)
|
|
172
|
+
const items = Array.isArray(data) ? data : [data];
|
|
173
|
+
for (const item of items) {
|
|
174
|
+
if (!item || typeof item !== "object") continue;
|
|
175
|
+
const html = String(item.htmlContext || item.html || item.content || "");
|
|
176
|
+
const left = [...new Set((html.match(/\{[A-Za-z][A-Za-z0-9_]*\}/g) || []))]
|
|
177
|
+
.filter((x) => x !== "{Unsubscribe}");
|
|
178
|
+
if (left.length) {
|
|
179
|
+
item.placeholdersRemaining = left.slice(0, 20);
|
|
180
|
+
item.placeholderNote = "以下占位符在预览里没有被替换(需要收件人/订单上下文),发送时会按真实数据渲染,不是模板写错;"
|
|
181
|
+
+ "不要把预览 HTML 当原模板回写";
|
|
182
|
+
}
|
|
173
183
|
}
|
|
174
184
|
} catch (e) { /* ignore */ }
|
|
175
185
|
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
@@ -831,16 +841,6 @@ defineTool(
|
|
|
831
841
|
}
|
|
832
842
|
);
|
|
833
843
|
|
|
834
|
-
defineTool(
|
|
835
|
-
"brand_profile",
|
|
836
|
-
"读取店铺品牌声音档案(品牌语气/禁用词/核心卖点)。**仅在客户提到品牌语气/禁用词/统一风格时调用**;普通写稿不必先查。未设置时返回 status=empty,用中性品牌语气继续,不要向客户强调'没设置档案'。",
|
|
837
|
-
{},
|
|
838
|
-
async () => {
|
|
839
|
-
const data = await callAssistantTool("get_brand_profile", {});
|
|
840
|
-
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
841
|
-
}
|
|
842
|
-
);
|
|
843
|
-
|
|
844
844
|
defineTool(
|
|
845
845
|
"contact_search",
|
|
846
846
|
"联系人模糊搜索(限本店):关键词≥2字符,匹配邮箱/手机/姓名/昵称/origin_id。每页最多50,按最近添加倒序;" +
|
|
@@ -1540,6 +1540,165 @@ name 最长 20 字。创建后 status=draft,人数由后台异步打包(可用 g
|
|
|
1540
1540
|
);
|
|
1541
1541
|
|
|
1542
1542
|
|
|
1543
|
+
// ==================== 订单列表 / 黑名单 / 退订名单 / 商品系列 ====================
|
|
1544
|
+
|
|
1545
|
+
defineTool(
|
|
1546
|
+
"order_list",
|
|
1547
|
+
"订单列表/最近订单(分页,默认近30天):订单号/状态/支付状态/金额/币种/下单与支付时间。用于'昨天多少单''这个客户买过什么'。",
|
|
1548
|
+
{
|
|
1549
|
+
...PAGE_PARAMS,
|
|
1550
|
+
start_time: z.string().optional().describe("开始时间 yyyy-MM-dd HH:mm:ss(默认30天前)"),
|
|
1551
|
+
end_time: z.string().optional().describe("结束时间 yyyy-MM-dd HH:mm:ss(默认现在)"),
|
|
1552
|
+
time_field: z.enum(["add_time", "paid_at"]).optional().describe("时间口径:add_time=下单时间(默认),paid_at=支付时间"),
|
|
1553
|
+
status: z.string().optional().describe("支付状态筛选,如 PAID / REFUNDED / CANCELLED"),
|
|
1554
|
+
keyword: z.string().optional().describe("精确匹配:邮箱 / 手机号 / 订单号(origin_id)"),
|
|
1555
|
+
},
|
|
1556
|
+
async ({ page, page_size, start_time, end_time, time_field, status, keyword }) => {
|
|
1557
|
+
const body = { page, pageSize: page_size };
|
|
1558
|
+
if (start_time) body.startTime = start_time;
|
|
1559
|
+
if (end_time) body.endTime = end_time;
|
|
1560
|
+
if (time_field) body.timeField = time_field;
|
|
1561
|
+
if (status) body.status = status;
|
|
1562
|
+
if (keyword) body.keyword = keyword;
|
|
1563
|
+
const data = await callApi("/api/v1/insight/order/list", body);
|
|
1564
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1565
|
+
}
|
|
1566
|
+
);
|
|
1567
|
+
|
|
1568
|
+
defineTool(
|
|
1569
|
+
"blacklist_list",
|
|
1570
|
+
"邮件黑名单列表(分页):邮箱/状态(blacklist=黑名单,inactive=不活跃)/来源/加入时间。排查'为什么这个人没收到'。",
|
|
1571
|
+
{
|
|
1572
|
+
...PAGE_PARAMS,
|
|
1573
|
+
status: z.enum(["blacklist", "inactive"]).optional().describe("不传=全部"),
|
|
1574
|
+
keyword: z.string().optional().describe("邮箱关键词"),
|
|
1575
|
+
},
|
|
1576
|
+
async ({ page, page_size, status, keyword }) => {
|
|
1577
|
+
const body = { page, pageSize: page_size };
|
|
1578
|
+
if (status) body.status = status;
|
|
1579
|
+
if (keyword) body.keyword = keyword;
|
|
1580
|
+
const data = await callApi("/api/v1/insight/blacklist/list", body);
|
|
1581
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1582
|
+
}
|
|
1583
|
+
);
|
|
1584
|
+
|
|
1585
|
+
defineTool(
|
|
1586
|
+
"audience_unsubscribed",
|
|
1587
|
+
"退订名单(分页):订阅状态=2 的联系人(按退订时间倒序)。channel=email|sms,默认 email。",
|
|
1588
|
+
{
|
|
1589
|
+
...PAGE_PARAMS,
|
|
1590
|
+
channel: z.enum(["email", "sms"]).optional().describe("渠道,默认 email"),
|
|
1591
|
+
keyword: z.string().optional().describe("邮箱/手机关键词"),
|
|
1592
|
+
start_time: z.string().optional().describe("退订时间起 yyyy-MM-dd HH:mm:ss(默认180天前)"),
|
|
1593
|
+
end_time: z.string().optional().describe("退订时间止"),
|
|
1594
|
+
},
|
|
1595
|
+
async ({ page, page_size, channel, keyword, start_time, end_time }) => {
|
|
1596
|
+
const body = { page, pageSize: page_size };
|
|
1597
|
+
if (channel) body.channel = channel;
|
|
1598
|
+
if (keyword) body.keyword = keyword;
|
|
1599
|
+
if (start_time) body.startTime = start_time;
|
|
1600
|
+
if (end_time) body.endTime = end_time;
|
|
1601
|
+
const data = await callApi("/api/v1/insight/audience/unsubscribed", body);
|
|
1602
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1603
|
+
}
|
|
1604
|
+
);
|
|
1605
|
+
|
|
1606
|
+
defineTool(
|
|
1607
|
+
"collection_list",
|
|
1608
|
+
"商品系列(collection)列表:名称/句柄/商品数。圈'买过某系列'人群前用它确认系列 id(order_collection 条件用)。",
|
|
1609
|
+
{
|
|
1610
|
+
...PAGE_PARAMS,
|
|
1611
|
+
keyword: z.string().optional().describe("系列名称关键词"),
|
|
1612
|
+
},
|
|
1613
|
+
async ({ page, page_size, keyword }) => {
|
|
1614
|
+
const body = { page, pageSize: page_size };
|
|
1615
|
+
if (keyword) body.keyword = keyword;
|
|
1616
|
+
const data = await callApi("/api/v1/insight/collection/list", body);
|
|
1617
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1618
|
+
}
|
|
1619
|
+
);
|
|
1620
|
+
|
|
1621
|
+
// ==================== 人群写操作(低风险:黑名单/订阅/标签) ====================
|
|
1622
|
+
|
|
1623
|
+
defineTool(
|
|
1624
|
+
"blacklist_add",
|
|
1625
|
+
`把邮箱加入黑名单(后续发送自动跳过)。支持单个或最多 50 个;已存在会恢复为黑名单。⚠️只加黑不删除,撤销需到后台。`,
|
|
1626
|
+
{
|
|
1627
|
+
email: z.union([z.string().min(3), z.array(z.string().min(3)).max(50)]).describe("邮箱或邮箱数组(≤50)"),
|
|
1628
|
+
},
|
|
1629
|
+
async ({ email }) => {
|
|
1630
|
+
const data = await callApi("/api/v1/audience/blacklist/add", { email });
|
|
1631
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1632
|
+
}
|
|
1633
|
+
);
|
|
1634
|
+
|
|
1635
|
+
defineTool(
|
|
1636
|
+
"contact_subscription",
|
|
1637
|
+
`改单个联系人的订阅状态(email/sms 二选一)。只影响这一个联系人,不会群发;变更会写订阅历史。`,
|
|
1638
|
+
{
|
|
1639
|
+
email: z.string().optional().describe("邮箱(与 phone/originId 三选一)"),
|
|
1640
|
+
phone: z.string().optional().describe("手机号(与 email/originId 三选一)"),
|
|
1641
|
+
origin_id: z.string().optional().describe("平台客户ID(与 email/phone 三选一)"),
|
|
1642
|
+
channel: z.enum(["email", "sms"]).describe("渠道"),
|
|
1643
|
+
subscribe: z.boolean().describe("true=订阅,false=退订"),
|
|
1644
|
+
},
|
|
1645
|
+
async ({ email, phone, origin_id, channel, subscribe }) => {
|
|
1646
|
+
if (!email && !phone && !origin_id) {
|
|
1647
|
+
return { isError: true, content: [{ type: "text", text: "email / phone / origin_id 三选一必填(可先用 contact_search 找到人)" }] };
|
|
1648
|
+
}
|
|
1649
|
+
const body = { channel, subscribe };
|
|
1650
|
+
if (email) body.email = email;
|
|
1651
|
+
if (phone) body.phone = phone;
|
|
1652
|
+
if (origin_id) body.originId = origin_id;
|
|
1653
|
+
const data = await callApi("/api/v1/audience/contact/subscription", body);
|
|
1654
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1655
|
+
}
|
|
1656
|
+
);
|
|
1657
|
+
|
|
1658
|
+
defineTool(
|
|
1659
|
+
"contact_tag_add",
|
|
1660
|
+
`给单个联系人加标签(tag_id 用 tag_list 查;幂等)。只影响这一个联系人。`,
|
|
1661
|
+
{
|
|
1662
|
+
email: z.string().optional().describe("邮箱(与 phone/origin_id 三选一)"),
|
|
1663
|
+
phone: z.string().optional().describe("手机号"),
|
|
1664
|
+
origin_id: z.string().optional().describe("平台客户ID"),
|
|
1665
|
+
tag_id: z.string().min(1).describe("标签id(tag_list 返回)"),
|
|
1666
|
+
},
|
|
1667
|
+
async ({ email, phone, origin_id, tag_id }) => {
|
|
1668
|
+
if (!email && !phone && !origin_id) {
|
|
1669
|
+
return { isError: true, content: [{ type: "text", text: "email / phone / origin_id 三选一必填(可先用 contact_search 找到人)" }] };
|
|
1670
|
+
}
|
|
1671
|
+
const body = { tag_id };
|
|
1672
|
+
if (email) body.email = email;
|
|
1673
|
+
if (phone) body.phone = phone;
|
|
1674
|
+
if (origin_id) body.originId = origin_id;
|
|
1675
|
+
const data = await callApi("/api/v1/audience/contact/tag/add", body);
|
|
1676
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1677
|
+
}
|
|
1678
|
+
);
|
|
1679
|
+
|
|
1680
|
+
defineTool(
|
|
1681
|
+
"contact_tag_remove",
|
|
1682
|
+
`移除单个联系人身上的某个标签(幂等)。只影响这一个联系人。`,
|
|
1683
|
+
{
|
|
1684
|
+
email: z.string().optional().describe("邮箱(与 phone/origin_id 三选一)"),
|
|
1685
|
+
phone: z.string().optional().describe("手机号"),
|
|
1686
|
+
origin_id: z.string().optional().describe("平台客户ID"),
|
|
1687
|
+
tag_id: z.string().min(1).describe("标签id(tag_list 返回)"),
|
|
1688
|
+
},
|
|
1689
|
+
async ({ email, phone, origin_id, tag_id }) => {
|
|
1690
|
+
if (!email && !phone && !origin_id) {
|
|
1691
|
+
return { isError: true, content: [{ type: "text", text: "email / phone / origin_id 三选一必填(可先用 contact_search 找到人)" }] };
|
|
1692
|
+
}
|
|
1693
|
+
const body = { tag_id };
|
|
1694
|
+
if (email) body.email = email;
|
|
1695
|
+
if (phone) body.phone = phone;
|
|
1696
|
+
if (origin_id) body.originId = origin_id;
|
|
1697
|
+
const data = await callApi("/api/v1/audience/contact/tag/remove", body);
|
|
1698
|
+
return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
|
|
1699
|
+
}
|
|
1700
|
+
);
|
|
1701
|
+
|
|
1543
1702
|
// ==================== 通用发现/调度工具(参考 Omnisend MCP 紧凑设计) ====================
|
|
1544
1703
|
|
|
1545
1704
|
/** 能力总览(按主题返回,避免一次性灌 50 条工具说明) */
|
|
@@ -1563,7 +1722,7 @@ const MCP_GUIDE = {
|
|
|
1563
1722
|
"- 分组:group_list / group_catalog(条件真源)/ group_members(自动区分手动/条件分组)",
|
|
1564
1723
|
"- 联系人:contact_get(精确查,含订单聚合)/ contact_send_status",
|
|
1565
1724
|
"- 报表:audience_growth / form_performance / domain_health / store_overview / order_stats / account_balance",
|
|
1566
|
-
"- 质检:email_audit(13 条规则+评分,deep=true 追加模型审查)
|
|
1725
|
+
"- 质检:email_audit(13 条规则+评分,deep=true 追加模型审查)",
|
|
1567
1726
|
"口径:报表默认近 180 天(可传 start_date/end_date 覆盖);订单已排除 CANCELLED;余额单位美元且为 group 级;联系人支持精确查(contact_get)与模糊搜索(contact_search:关键词≥2字符、每页≤50、结果多时改用分组)。",
|
|
1568
1727
|
].join("\n"),
|
|
1569
1728
|
drafts: [
|
package/package.json
CHANGED
|
@@ -53,7 +53,7 @@ description: 曼巴 MambaSMS 营销自动化 MCP(@mambasms/mcp-server)使用技
|
|
|
53
53
|
|
|
54
54
|
## 3. 不可违反的硬规则(全模块通用)
|
|
55
55
|
|
|
56
|
-
1.
|
|
56
|
+
1. **写操作只做低风险**:活动/流程/分组一律只建草稿(`status=draft`,不发送、不启用、不扣费);联系人侧只允许“单人订阅状态、单人标签、加黑名单”这类动作。绝不宣称“已发送/已上线”。
|
|
57
57
|
2. **先问再做**:第一次做邮件/人群/流程前按 `modules/ask-first.md` 确认;**客户说“做个模板/建封邮件”只算说清用途、不算选了形式**(模板≠组件:系统模板只有组件形态,客户想要的可能是 HTML/富文本成品),仍要一句话问清;客户已明确选定形式则不再重复问;客户说“你决定”时按默认(富文本)执行并告知。
|
|
58
58
|
3. **先查目录再写**:模板查 `catalog_query`、分组查 `group_catalog`、流程查 `flow_triggers`。禁止凭印象编字段/操作符。
|
|
59
59
|
4. **社媒与页脚用平台的**:社媒优先由系统模板页脚生成;手写时只用 `template_snippets(type=footer-social)` 的图标片段,放最底部(退订上方)。**禁止**文字按钮冒充社媒、禁止正文中部放社媒区。
|
|
@@ -79,3 +79,15 @@ query_content = [
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
81
|
**可执行示例(契约)**:[`../examples/audiences.json`](../examples/audiences.json) —— CI 会用测试店铺真跑一遍,文档与实现漂移会立刻报错。
|
|
82
|
+
|
|
83
|
+
## 8. 名单与联系人写操作(低风险)
|
|
84
|
+
|
|
85
|
+
| 需求 | 工具 | 说明 |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| 查黑名单 | `blacklist_list(status, keyword)` | 排查"这个人为什么没收到";`blacklist`=黑名单、`inactive`=不活跃 |
|
|
88
|
+
| 加黑 | `blacklist_add(email 或 [email])` | ≤50 个/次;幂等;**撤销要回后台** |
|
|
89
|
+
| 查退订名单 | `audience_unsubscribed(channel=email\|sms)` | 订阅状态=2 的人,按退订时间倒序 |
|
|
90
|
+
| 改单人订阅 | `contact_subscription(email/phone/originId, channel, subscribe)` | 只影响一个人,写订阅历史 |
|
|
91
|
+
| 加/去标签 | `contact_tag_add` / `contact_tag_remove`(配 `tag_list` 的 tag_id) | 只影响一个人,幂等 |
|
|
92
|
+
|
|
93
|
+
> 这些都是"单人/小批量"动作。**群发、批量退订、删除联系人仍然只能后台做**——不要承诺。
|
|
@@ -81,9 +81,6 @@
|
|
|
81
81
|
2. 找不到就 `product_list(page_size=20~50)` 拉近期商品**按语义挑**(标题里可能是 "Sneaker 2.0" 而不是 "shoe")
|
|
82
82
|
3. 仍没有 → **问客户要商品名或商品链接**,不要说“店铺没有这个商品”
|
|
83
83
|
|
|
84
|
-
**品牌声音**:**只在客户提到"品牌语气/禁用词/统一风格"时才调** `brand_profile()`;普通写稿不用先查。为空(`status=empty`)是正常的。
|
|
85
|
-
- 直接用中性品牌语气写,**不要**向客户汇报“还没设置品牌档案”
|
|
86
|
-
- 客户问“怎么统一语气”时,才建议去后台设置品牌声音(语气/禁用词/卖点)
|
|
87
84
|
|
|
88
85
|
## 5. 修改内容(只有草稿能改)
|
|
89
86
|
|
|
@@ -94,3 +94,8 @@
|
|
|
94
94
|
| `product_list` | 默认只在售(ACTIVE),币种看 `currency` | 把停售商品拿去发信 |
|
|
95
95
|
| `contact_send_status` | 每来源最多 50 条,看 `total`/`truncated` | 把 `returned` 当总数 |
|
|
96
96
|
| 订阅状态 | `1=已订阅`、`2=已退订`、`0=未订阅`(已附中文说明字段) | 看到 2 说"已订阅" |
|
|
97
|
+
## 订单列表与商品系列
|
|
98
|
+
|
|
99
|
+
- `order_list(start_time, end_time, status, keyword, time_field)`:最近订单/按客户查单;`time_field=add_time`(下单,默认)或 `paid_at`(支付);`status` 传 `PAID`/`REFUNDED`/`CANCELLED`;`keyword` 支持邮箱/手机/订单号精确匹配
|
|
100
|
+
- `order_detail(order_id/origin_id)`:单笔明细(含商品行)
|
|
101
|
+
- `collection_list(keyword)`:商品系列 id + 商品数;圈"买过某系列"必须先用它确认真实系列 id
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
| `contact_search` | `keyword`(≥2字符) | `page` `page_size`(≤50) |
|
|
48
48
|
| `contact_send_status` | `keyword`(邮箱或手机号) | `campaigns_id` `flow_id` |
|
|
49
49
|
| `email_audit` | — | `source`(`campaigns`/`flow`) `campaigns_id` `flow_id` `node_uuid` `deep` |
|
|
50
|
-
| `brand_profile` | — | — |
|
|
51
50
|
| `audience_growth` | — | `days`(默认30,≤90) |
|
|
52
51
|
| `form_performance` | — | `forms_id` `days` |
|
|
53
52
|
| `domain_health` | — | — |
|