feat: 完善视频任务与 KOC 资源库
This commit is contained in:
@@ -32,6 +32,8 @@ const toolOutputSchema = z.object({
|
||||
due_date: z.string(),
|
||||
sheet_name: z.string(),
|
||||
note_count: z.number().int().nonnegative(),
|
||||
platform: z.enum(["小红书", "抖音"]),
|
||||
content_format: z.enum(["image_text", "video"]),
|
||||
claim_url: z.string().url(),
|
||||
});
|
||||
|
||||
@@ -57,7 +59,7 @@ function createServer(context: McpRequestContext) {
|
||||
{
|
||||
title: "创建 KOC 分发任务",
|
||||
description:
|
||||
"读取飞书电子表格中的标题、正文和配图,在 KOC LOOP 创建分发任务,并返回可直接发给 KOC 的领取链接。飞书表格若有多个工作表,链接必须包含目标 sheet 参数。",
|
||||
"读取飞书电子表格中的标题、正文及图片或视频,在 KOC LOOP 创建小红书/抖音分发任务,并返回可直接发给 KOC 的领取链接。飞书表格若有多个工作表,链接必须包含目标 sheet 参数。",
|
||||
inputSchema: z.object({
|
||||
feishu_url: z
|
||||
.string()
|
||||
@@ -74,6 +76,14 @@ function createServer(context: McpRequestContext) {
|
||||
.max(100)
|
||||
.optional()
|
||||
.describe("品牌或项目名称;未提供时系统记录为“未设置项目”"),
|
||||
platform: z
|
||||
.enum(["小红书", "抖音"])
|
||||
.optional()
|
||||
.describe("发布平台,默认小红书"),
|
||||
content_format: z
|
||||
.enum(["image_text", "video"])
|
||||
.optional()
|
||||
.describe("内容形式:image_text 图文,video 视频;默认图文"),
|
||||
}),
|
||||
outputSchema: toolOutputSchema,
|
||||
annotations: {
|
||||
@@ -83,7 +93,7 @@ function createServer(context: McpRequestContext) {
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
async ({ feishu_url, task_name, due_date, brand_project }) => {
|
||||
async ({ feishu_url, task_name, due_date, brand_project, platform, content_format }) => {
|
||||
try {
|
||||
const bindings = getBindings();
|
||||
const portalUrl = String(bindings.KOC_PORTAL_URL ?? "").trim();
|
||||
@@ -96,6 +106,8 @@ function createServer(context: McpRequestContext) {
|
||||
name: task_name,
|
||||
brand: brand_project?.trim() || "未设置项目",
|
||||
dueAt: due_date,
|
||||
platform: platform ?? "小红书",
|
||||
contentFormat: content_format ?? "image_text",
|
||||
},
|
||||
bindings,
|
||||
{ deduplicate: true },
|
||||
@@ -108,6 +120,8 @@ function createServer(context: McpRequestContext) {
|
||||
due_date: result.dueAt,
|
||||
sheet_name: result.sheetName,
|
||||
note_count: result.noteCount,
|
||||
platform: result.platform,
|
||||
content_format: result.contentFormat,
|
||||
claim_url: buildClaimUrl(portalUrl, result.shareToken),
|
||||
};
|
||||
const actionText = result.created ? "已创建" : "已找到相同任务";
|
||||
@@ -115,7 +129,7 @@ function createServer(context: McpRequestContext) {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: `${actionText}“${result.name}”,共 ${result.noteCount} 篇笔记。领取链接:${output.claim_url}`,
|
||||
text: `${actionText}“${result.name}”,平台:${result.platform},内容形式:${result.contentFormat === "video" ? "视频" : "图文"},共 ${result.noteCount} 篇。领取链接:${output.claim_url}`,
|
||||
},
|
||||
],
|
||||
structuredContent: output,
|
||||
|
||||
Reference in New Issue
Block a user