owner-clone-ai-mcp 1.7.0 → 1.8.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.
- package/index.js +146 -28
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -406,7 +406,24 @@ const TOOLS = [
|
|
|
406
406
|
|
|
407
407
|
▸ google_sheets_write(スプレッドシートに書き込み)
|
|
408
408
|
{ "type": "action", "label": "スプレッドシートに保存", "action_type": "google_sheets_write",
|
|
409
|
-
"spreadsheet_id": "スプレッドシートID", "sheet_range": "Sheet1!A:A"
|
|
409
|
+
"spreadsheet_id": "スプレッドシートID", "sheet_range": "Sheet1!A:A",
|
|
410
|
+
"row_values": ["__output__"] } ← __output__ は前ステップ出力を自動挿入
|
|
411
|
+
|
|
412
|
+
▸ check_chatwork(ChatWorkの未読メッセージ取得)
|
|
413
|
+
{ "type": "action", "label": "ChatWork受信確認", "action_type": "check_chatwork",
|
|
414
|
+
"chatwork_setting_id": "ChatWork設定ID" }
|
|
415
|
+
→ 取得した本文が次ステップに引き継がれる
|
|
416
|
+
|
|
417
|
+
▸ save_email_draft(メール下書き保存)
|
|
418
|
+
{ "type": "action", "label": "メール下書き作成", "action_type": "save_email_draft",
|
|
419
|
+
"email_setting_id": "メール設定ID",
|
|
420
|
+
"to_email": "宛先(省略時はcheck_emailの差出人)",
|
|
421
|
+
"subject": "件名" }
|
|
422
|
+
|
|
423
|
+
▸ post_sns(SNSへ投稿)
|
|
424
|
+
{ "type": "action", "label": "SNS投稿", "action_type": "post_sns",
|
|
425
|
+
"sns_setting_id": "SNS設定ID",
|
|
426
|
+
"post_title": "投稿タイトル(省略可)" }
|
|
410
427
|
|
|
411
428
|
■ 典型的なワークフロー構成例:
|
|
412
429
|
|
|
@@ -524,12 +541,58 @@ diagnostic_mode=true の場合、必ず diagnostic_result_mode も指定する:
|
|
|
524
541
|
→ おすすめ: 課題特定フロー・商品レコメンド・お悩み分岐診断
|
|
525
542
|
|
|
526
543
|
diagnostic_strict_result=true: 結果が確定した瞬間に即表示(全問回答を待たない)。
|
|
527
|
-
diagnostic_ai_text_enabled=false: 質問間のAI会話文を省略してフォーム形式に(count/score
|
|
544
|
+
diagnostic_ai_text_enabled=false: 質問間のAI会話文を省略してフォーム形式に(count/scoreモードで高速化したい場合)。
|
|
545
|
+
|
|
546
|
+
■ 診断の質問・結果データ(diagnostic_questions / diagnostic_results):
|
|
547
|
+
|
|
548
|
+
diagnostic_questions — 質問の配列。各要素のフォーマット:
|
|
549
|
+
ai/count/scoreモード:
|
|
550
|
+
{ "id": "q1", "question": "質問文", "survey_type": "choices",
|
|
551
|
+
"choices": ["選択肢A", "選択肢B", "選択肢C"] }
|
|
552
|
+
※ scoreモードの場合は choice_scores を追加:
|
|
553
|
+
"choice_scores": { "0": {"result-id": 3}, "1": {"result-id": 1} }
|
|
554
|
+
(choices配列インデックス → { 結果ID: 点数 } のマッピング)
|
|
555
|
+
|
|
556
|
+
branchモード(各選択肢が次の質問/結果へリンク):
|
|
557
|
+
{ "id": "q1", "question": "質問文", "survey_type": "choices",
|
|
558
|
+
"choices": [
|
|
559
|
+
{ "id": "c1", "text": "はい", "next": "q2" },
|
|
560
|
+
{ "id": "c2", "text": "いいえ", "next": "result-A" }
|
|
561
|
+
] }
|
|
562
|
+
|
|
563
|
+
diagnostic_results — 結果の配列。各要素のフォーマット:
|
|
564
|
+
{ "id": "result-A", "label": "結果タイトル",
|
|
565
|
+
"condition_hint": "このユーザーはどんな人か(ai/countモードでAIが判定するヒント)",
|
|
566
|
+
"badge": "#3b82f6", "bg": "#3b82f618", "text": "#3b82f6",
|
|
567
|
+
"blocks": [] }
|
|
568
|
+
|
|
569
|
+
■ 診断後のCTA(行動喚起)設定:
|
|
570
|
+
diagnostic_goal_cta: ボタンに表示するテキスト(例: "無料相談に申し込む")
|
|
571
|
+
diagnostic_goal_url: ボタンのリンク先URL
|
|
572
|
+
diagnostic_goal_button_text: ボタン上のメインラベル(cta より具体的な文言)
|
|
573
|
+
|
|
574
|
+
■ エスカレーション(有人対応への切り替え):
|
|
575
|
+
特定のキーワードが出たとき、または「担当者につないでほしい」などのリクエストで、
|
|
576
|
+
チャットの対応を人に切り替える機能。
|
|
577
|
+
escalation_enabled=true で有効化。
|
|
578
|
+
escalation_trigger: "user_request"(ユーザーが明示的に要求したとき)または "keyword"(キーワード検出)
|
|
579
|
+
escalation_email: 通知先メールアドレス
|
|
580
|
+
escalation_chatwork_room_id: 通知先ChatWorkルームID
|
|
581
|
+
escalation_message: エスカレーション時にユーザーへ表示するメッセージ
|
|
582
|
+
escalation_keywords: 検出するキーワード(改行区切り)
|
|
583
|
+
|
|
584
|
+
■ ヘッダー:
|
|
585
|
+
header_title: チャットウィンドウ上部に表示するタイトル(例: "○○サポート")。省略時はチャットボット名。
|
|
586
|
+
|
|
587
|
+
■ Branchモードのボタンラベル:
|
|
588
|
+
branch_yes_label: Yesボタンの表示テキスト(デフォルト: "はい")
|
|
589
|
+
branch_no_label: Noボタンの表示テキスト(デフォルト: "いいえ")`,
|
|
528
590
|
annotations: { destructiveHint: false, idempotentHint: false },
|
|
529
591
|
inputSchema: {
|
|
530
592
|
type: 'object',
|
|
531
593
|
properties: {
|
|
532
594
|
name: { type: 'string', description: 'チャットボット名(例: 「ECサイト問い合わせBot」)' },
|
|
595
|
+
header_title: { type: 'string', description: 'チャットウィンドウ上部のヘッダータイトル。省略時はname(チャットボット名)を使用。' },
|
|
533
596
|
system_prompt: { type: 'string', description: 'AIの人格・役割・回答スタイルを定義するメインプロンプト。チャット時に毎回注入される。' },
|
|
534
597
|
initial_message: { type: 'string', description: 'チャット開始時にAIが最初に表示するメッセージ。ユーザーへの歓迎・誘導文。' },
|
|
535
598
|
rules_allow: { type: 'string', description: '許可ルール。改行区切り箇条書き。AIが積極的に行うべきこと。' },
|
|
@@ -545,10 +608,31 @@ diagnostic_ai_text_enabled=false: 質問間のAI会話文を省略してフォ
|
|
|
545
608
|
diagnostic_result_mode: {
|
|
546
609
|
type: 'string',
|
|
547
610
|
enum: ['ai', 'count', 'score', 'branch'],
|
|
548
|
-
description: '診断判定ロジック。
|
|
611
|
+
description: '診断判定ロジック。ai=AI総合判断(自由記述向き)/ count=最多選択番号判定(選択式向き)/ score=ポイント合計(重み付け向き)/ branch=Yes/No分岐型(決定木向き)',
|
|
549
612
|
},
|
|
550
|
-
diagnostic_strict_result:
|
|
613
|
+
diagnostic_strict_result: { type: 'boolean', description: 'true=結果確定時に即表示(全問回答を待たない)。デフォルト: false' },
|
|
551
614
|
diagnostic_ai_text_enabled: { type: 'boolean', description: 'false=質問間のAI会話文を省略してフォーム形式に高速化(count/scoreモード推奨)。デフォルト: true' },
|
|
615
|
+
diagnostic_questions: {
|
|
616
|
+
type: 'array',
|
|
617
|
+
description: '診断の質問配列。各要素: {id, question, survey_type:"choices", choices:[...]}。branchモードはchoices内に{id,text,next}を使用。',
|
|
618
|
+
items: { type: 'object' },
|
|
619
|
+
},
|
|
620
|
+
diagnostic_results: {
|
|
621
|
+
type: 'array',
|
|
622
|
+
description: '診断の結果配列。各要素: {id, label, condition_hint, badge:"#色", bg:"#色18", text:"#色", blocks:[]}。',
|
|
623
|
+
items: { type: 'object' },
|
|
624
|
+
},
|
|
625
|
+
diagnostic_goal_cta: { type: 'string', description: '診断結果後のCTAボタンテキスト(例: "無料相談に申し込む")' },
|
|
626
|
+
diagnostic_goal_url: { type: 'string', description: '診断結果後のCTAボタンリンク先URL' },
|
|
627
|
+
diagnostic_goal_button_text: { type: 'string', description: '診断結果後のボタン表示テキスト' },
|
|
628
|
+
escalation_enabled: { type: 'boolean', description: 'true=有人対応切り替え機能を有効化。デフォルト: false' },
|
|
629
|
+
escalation_trigger: { type: 'string', description: 'エスカレーション発動条件: "user_request"(ユーザーが要求した時)/ "keyword"(キーワード検出時)', enum: ['user_request', 'keyword'] },
|
|
630
|
+
escalation_email: { type: 'string', description: 'エスカレーション通知先メールアドレス(省略可)' },
|
|
631
|
+
escalation_chatwork_room_id: { type: 'string', description: 'エスカレーション通知先ChatWorkルームID(省略可)' },
|
|
632
|
+
escalation_message: { type: 'string', description: 'エスカレーション時にユーザーへ表示するメッセージ。デフォルト: "担当者に繋ぎます…"' },
|
|
633
|
+
escalation_keywords: { type: 'string', description: 'keyword triggerの場合のキーワードリスト。改行区切り。' },
|
|
634
|
+
branch_yes_label: { type: 'string', description: 'branchモードのYesボタン表示テキスト(デフォルト: "はい")' },
|
|
635
|
+
branch_no_label: { type: 'string', description: 'branchモードのNoボタン表示テキスト(デフォルト: "いいえ")' },
|
|
552
636
|
},
|
|
553
637
|
required: ['name'],
|
|
554
638
|
},
|
|
@@ -557,28 +641,43 @@ diagnostic_ai_text_enabled=false: 質問間のAI会話文を省略してフォ
|
|
|
557
641
|
name: 'update_chatbot',
|
|
558
642
|
description: `既存のチャットボットを更新します。【書き込み権限付きキーが必要】
|
|
559
643
|
指定したフィールドのみ更新され、省略したフィールドは現在値を維持します。
|
|
644
|
+
diagnostic_questions / diagnostic_results を渡すと全データが置換されます(差分更新ではない)。
|
|
560
645
|
各フィールドの意味は create_chatbot と同じです。`,
|
|
561
646
|
annotations: { destructiveHint: false, idempotentHint: true },
|
|
562
647
|
inputSchema: {
|
|
563
648
|
type: 'object',
|
|
564
649
|
properties: {
|
|
565
|
-
id:
|
|
566
|
-
name:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
650
|
+
id: { type: 'string', description: 'チャットボットID(list_chatbotsで確認)' },
|
|
651
|
+
name: { type: 'string', description: '新しい名前(省略時は変更なし)' },
|
|
652
|
+
header_title: { type: 'string', description: '新しいヘッダータイトル(省略時は変更なし)' },
|
|
653
|
+
system_prompt: { type: 'string', description: '新しいシステムプロンプト(省略時は変更なし)' },
|
|
654
|
+
initial_message: { type: 'string', description: '新しい最初のメッセージ(省略時は変更なし)' },
|
|
655
|
+
rules_allow: { type: 'string', description: '新しい許可ルール・改行区切り(省略時は変更なし)' },
|
|
656
|
+
rules_deny: { type: 'string', description: '新しい禁止ルール・改行区切り(省略時は変更なし)' },
|
|
657
|
+
sales_flow: { type: 'string', description: '新しい対話フロー(省略時は変更なし)' },
|
|
658
|
+
quick_replies: { type: 'string', description: '新しいクイック返信・改行区切り(省略時は変更なし)' },
|
|
659
|
+
ai_provider: { type: 'string', description: '新しいAIエンジン(省略時は変更なし)', enum: ['claude', 'openai', 'gemini', 'openrouter', 'groq'] },
|
|
660
|
+
ai_model: { type: 'string', description: '新しいモデル(省略時は変更なし)' },
|
|
661
|
+
knowledge_semantic_search: { type: 'boolean', description: 'ナレッジ検索モード変更(省略時は変更なし)' },
|
|
662
|
+
knowledge_query_rewrite: { type: 'boolean', description: 'クエリ最適化モード変更(省略時は変更なし)' },
|
|
663
|
+
knowledge_smart_full_text: { type: 'boolean', description: 'スマート全文取得モード変更(省略時は変更なし)' },
|
|
664
|
+
diagnostic_mode: { type: 'boolean', description: '診断フロー有効/無効(省略時は変更なし)' },
|
|
665
|
+
diagnostic_result_mode: { type: 'string', description: '診断判定ロジック変更: ai / count / score / branch(省略時は変更なし)', enum: ['ai', 'count', 'score', 'branch'] },
|
|
666
|
+
diagnostic_strict_result: { type: 'boolean', description: '即時結果表示の変更(省略時は変更なし)' },
|
|
667
|
+
diagnostic_ai_text_enabled: { type: 'boolean', description: '質問間のAI会話文生成の変更(省略時は変更なし)' },
|
|
668
|
+
diagnostic_questions: { type: 'array', description: '診断質問を全置換(省略時は変更なし)', items: { type: 'object' } },
|
|
669
|
+
diagnostic_results: { type: 'array', description: '診断結果を全置換(省略時は変更なし)', items: { type: 'object' } },
|
|
670
|
+
diagnostic_goal_cta: { type: 'string', description: '診断後CTAボタンテキスト(省略時は変更なし)' },
|
|
671
|
+
diagnostic_goal_url: { type: 'string', description: '診断後CTAリンク先(省略時は変更なし)' },
|
|
672
|
+
diagnostic_goal_button_text: { type: 'string', description: '診断後ボタンテキスト(省略時は変更なし)' },
|
|
673
|
+
escalation_enabled: { type: 'boolean', description: 'エスカレーション有効/無効(省略時は変更なし)' },
|
|
674
|
+
escalation_trigger: { type: 'string', description: 'エスカレーション発動条件変更(省略時は変更なし)', enum: ['user_request', 'keyword'] },
|
|
675
|
+
escalation_email: { type: 'string', description: 'エスカレーション通知メール(省略時は変更なし)' },
|
|
676
|
+
escalation_chatwork_room_id: { type: 'string', description: 'エスカレーション通知ChatWorkルームID(省略時は変更なし)' },
|
|
677
|
+
escalation_message: { type: 'string', description: 'エスカレーション時のメッセージ(省略時は変更なし)' },
|
|
678
|
+
escalation_keywords: { type: 'string', description: 'エスカレーションキーワード改行区切り(省略時は変更なし)' },
|
|
679
|
+
branch_yes_label: { type: 'string', description: 'branchモードYesボタンテキスト(省略時は変更なし)' },
|
|
680
|
+
branch_no_label: { type: 'string', description: 'branchモードNoボタンテキスト(省略時は変更なし)' },
|
|
582
681
|
},
|
|
583
682
|
required: ['id'],
|
|
584
683
|
},
|
|
@@ -1010,27 +1109,46 @@ async function executeTool(name, args) {
|
|
|
1010
1109
|
|
|
1011
1110
|
case 'create_chatbot': {
|
|
1012
1111
|
const cbCreate = {};
|
|
1013
|
-
const cbAllFields = [
|
|
1112
|
+
const cbAllFields = [
|
|
1113
|
+
'name','header_title','system_prompt','initial_message','rules_allow','rules_deny',
|
|
1014
1114
|
'sales_flow','quick_replies','ai_provider','ai_model',
|
|
1015
1115
|
'knowledge_query_rewrite','knowledge_smart_full_text',
|
|
1016
|
-
'diagnostic_mode','diagnostic_result_mode','diagnostic_strict_result','diagnostic_ai_text_enabled'
|
|
1116
|
+
'diagnostic_mode','diagnostic_result_mode','diagnostic_strict_result','diagnostic_ai_text_enabled',
|
|
1117
|
+
'diagnostic_goal_cta','diagnostic_goal_url','diagnostic_goal_button_text',
|
|
1118
|
+
'escalation_enabled','escalation_trigger','escalation_email',
|
|
1119
|
+
'escalation_chatwork_room_id','escalation_message','escalation_keywords',
|
|
1120
|
+
'branch_yes_label','branch_no_label',
|
|
1121
|
+
];
|
|
1017
1122
|
cbAllFields.forEach(f => { if (args[f] !== undefined) cbCreate[f] = args[f]; });
|
|
1018
1123
|
if (Array.isArray(args.knowledge_item_ids)) cbCreate.knowledge_item_ids = args.knowledge_item_ids;
|
|
1124
|
+
if (Array.isArray(args.diagnostic_questions)) cbCreate.diagnostic_questions = args.diagnostic_questions;
|
|
1125
|
+
if (Array.isArray(args.diagnostic_results)) cbCreate.diagnostic_results = args.diagnostic_results;
|
|
1019
1126
|
const data = await callApi('/chatbots', {
|
|
1020
1127
|
method: 'POST',
|
|
1021
1128
|
body: JSON.stringify(cbCreate),
|
|
1022
1129
|
});
|
|
1023
|
-
const diagInfo = cbCreate.diagnostic_mode
|
|
1024
|
-
|
|
1130
|
+
const diagInfo = cbCreate.diagnostic_mode
|
|
1131
|
+
? `\n診断モード: ON (${cbCreate.diagnostic_result_mode || 'ai'}) / 質問数: ${(cbCreate.diagnostic_questions || []).length} / 結果数: ${(cbCreate.diagnostic_results || []).length}`
|
|
1132
|
+
: '';
|
|
1133
|
+
const escInfo = cbCreate.escalation_enabled ? '\nエスカレーション: ON' : '';
|
|
1134
|
+
return `✅ ${data.message}\nID: ${data.id}\n名前: ${data.name}\nAI: ${data.ai_provider || 'claude'}\nwidget_token: ${data.widget_token}\n紐付けナレッジ: ${data.linked_knowledge_count ?? 0}件${diagInfo}${escInfo}`;
|
|
1025
1135
|
}
|
|
1026
1136
|
|
|
1027
1137
|
case 'update_chatbot': {
|
|
1028
1138
|
const body = {};
|
|
1029
|
-
const cbFields = [
|
|
1139
|
+
const cbFields = [
|
|
1140
|
+
'name','header_title','system_prompt','initial_message','rules_allow','rules_deny',
|
|
1030
1141
|
'sales_flow','quick_replies','ai_provider','ai_model',
|
|
1031
1142
|
'knowledge_semantic_search','knowledge_query_rewrite','knowledge_smart_full_text',
|
|
1032
|
-
'diagnostic_mode','diagnostic_result_mode','diagnostic_strict_result','diagnostic_ai_text_enabled'
|
|
1143
|
+
'diagnostic_mode','diagnostic_result_mode','diagnostic_strict_result','diagnostic_ai_text_enabled',
|
|
1144
|
+
'diagnostic_goal_cta','diagnostic_goal_url','diagnostic_goal_button_text',
|
|
1145
|
+
'escalation_enabled','escalation_trigger','escalation_email',
|
|
1146
|
+
'escalation_chatwork_room_id','escalation_message','escalation_keywords',
|
|
1147
|
+
'branch_yes_label','branch_no_label',
|
|
1148
|
+
];
|
|
1033
1149
|
cbFields.forEach(f => { if (args[f] !== undefined) body[f] = args[f]; });
|
|
1150
|
+
if (Array.isArray(args.diagnostic_questions)) body.diagnostic_questions = args.diagnostic_questions;
|
|
1151
|
+
if (Array.isArray(args.diagnostic_results)) body.diagnostic_results = args.diagnostic_results;
|
|
1034
1152
|
const data = await callApi(`/chatbots/${args.id}`, {
|
|
1035
1153
|
method: 'PATCH',
|
|
1036
1154
|
body: JSON.stringify(body),
|
|
@@ -1094,7 +1212,7 @@ async function executeTool(name, args) {
|
|
|
1094
1212
|
// ── MCPサーバー起動 ────────────────────────────────────────────
|
|
1095
1213
|
async function main() {
|
|
1096
1214
|
const server = new Server(
|
|
1097
|
-
{ name: 'owner-clone-ai', version: '1.
|
|
1215
|
+
{ name: 'owner-clone-ai', version: '1.8.0' },
|
|
1098
1216
|
{ capabilities: { tools: {} } }
|
|
1099
1217
|
);
|
|
1100
1218
|
|