owner-clone-ai-mcp 1.0.0 → 1.1.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 +85 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -30,9 +30,11 @@ async function callApi(path, options = {}) {
|
|
|
30
30
|
|
|
31
31
|
// ── ツール定義 ─────────────────────────────────────────────────
|
|
32
32
|
const TOOLS = [
|
|
33
|
+
// 読み取り専用ツール
|
|
33
34
|
{
|
|
34
35
|
name: 'search_knowledge',
|
|
35
36
|
description: 'Owner Clone AIのナレッジベースを検索します。セマンティック検索(意味検索)とキーワード検索を使用します。',
|
|
37
|
+
annotations: { readOnlyHint: true },
|
|
36
38
|
inputSchema: {
|
|
37
39
|
type: 'object',
|
|
38
40
|
properties: {
|
|
@@ -45,6 +47,7 @@ const TOOLS = [
|
|
|
45
47
|
{
|
|
46
48
|
name: 'list_knowledge_items',
|
|
47
49
|
description: 'Owner Clone AIに登録されたナレッジの一覧を取得します。フォルダやカテゴリで絞り込み可能。',
|
|
50
|
+
annotations: { readOnlyHint: true },
|
|
48
51
|
inputSchema: {
|
|
49
52
|
type: 'object',
|
|
50
53
|
properties: {
|
|
@@ -58,6 +61,7 @@ const TOOLS = [
|
|
|
58
61
|
{
|
|
59
62
|
name: 'get_knowledge_item',
|
|
60
63
|
description: '指定したIDのナレッジの全文を取得します。',
|
|
64
|
+
annotations: { readOnlyHint: true },
|
|
61
65
|
inputSchema: {
|
|
62
66
|
type: 'object',
|
|
63
67
|
properties: {
|
|
@@ -69,16 +73,19 @@ const TOOLS = [
|
|
|
69
73
|
{
|
|
70
74
|
name: 'list_knowledge_folders',
|
|
71
75
|
description: 'ナレッジのフォルダ一覧を取得します。',
|
|
76
|
+
annotations: { readOnlyHint: true },
|
|
72
77
|
inputSchema: { type: 'object', properties: {} },
|
|
73
78
|
},
|
|
74
79
|
{
|
|
75
80
|
name: 'list_agent_presets',
|
|
76
81
|
description: 'AIパートナー(エージェントプリセット)の一覧を取得します。システムプリセットも含みます。ナレッジ内容は含みません。',
|
|
82
|
+
annotations: { readOnlyHint: true },
|
|
77
83
|
inputSchema: { type: 'object', properties: {} },
|
|
78
84
|
},
|
|
79
85
|
{
|
|
80
86
|
name: 'get_agent_preset',
|
|
81
87
|
description: '指定したIDのAIパートナーの詳細(システムプロンプト・ルール)を取得します。セキュリティ上、紐づくナレッジの内容は返しません。',
|
|
88
|
+
annotations: { readOnlyHint: true },
|
|
82
89
|
inputSchema: {
|
|
83
90
|
type: 'object',
|
|
84
91
|
properties: {
|
|
@@ -87,6 +94,53 @@ const TOOLS = [
|
|
|
87
94
|
required: ['id'],
|
|
88
95
|
},
|
|
89
96
|
},
|
|
97
|
+
// 書き込みツール(読み書き可能キーが必要)
|
|
98
|
+
{
|
|
99
|
+
name: 'create_knowledge',
|
|
100
|
+
description: 'Owner Clone AIにナレッジを新規作成します。【書き込み権限付きキーが必要】作成後、自動的にベクトル化されセマンティック検索に対応します。',
|
|
101
|
+
annotations: { destructiveHint: false, idempotentHint: false },
|
|
102
|
+
inputSchema: {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {
|
|
105
|
+
title: { type: 'string', description: 'ナレッジのタイトル' },
|
|
106
|
+
text_content: { type: 'string', description: 'ナレッジの本文テキスト' },
|
|
107
|
+
category: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
description: 'カテゴリ(product / profile / testimonial / persona / tone / other)',
|
|
110
|
+
enum: ['product', 'profile', 'testimonial', 'persona', 'tone', 'other'],
|
|
111
|
+
},
|
|
112
|
+
folder_id: { type: 'string', description: 'フォルダID(省略可)' },
|
|
113
|
+
},
|
|
114
|
+
required: ['title', 'text_content'],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'update_knowledge',
|
|
119
|
+
description: '既存のナレッジを更新します。【書き込み権限付きキーが必要】本文を変更した場合は自動的に再ベクトル化されます。',
|
|
120
|
+
annotations: { destructiveHint: false, idempotentHint: true },
|
|
121
|
+
inputSchema: {
|
|
122
|
+
type: 'object',
|
|
123
|
+
properties: {
|
|
124
|
+
id: { type: 'string', description: '更新するナレッジのID' },
|
|
125
|
+
title: { type: 'string', description: '新しいタイトル(省略時は変更なし)' },
|
|
126
|
+
text_content: { type: 'string', description: '新しい本文(省略時は変更なし)' },
|
|
127
|
+
category: { type: 'string', description: '新しいカテゴリ(省略時は変更なし)' },
|
|
128
|
+
},
|
|
129
|
+
required: ['id'],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'delete_knowledge',
|
|
134
|
+
description: '指定したナレッジを削除します。【書き込み権限付きキーが必要】この操作は元に戻せません。',
|
|
135
|
+
annotations: { destructiveHint: true, idempotentHint: false },
|
|
136
|
+
inputSchema: {
|
|
137
|
+
type: 'object',
|
|
138
|
+
properties: {
|
|
139
|
+
id: { type: 'string', description: '削除するナレッジのID' },
|
|
140
|
+
},
|
|
141
|
+
required: ['id'],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
90
144
|
];
|
|
91
145
|
|
|
92
146
|
// ── ツール実行 ─────────────────────────────────────────────────
|
|
@@ -155,6 +209,36 @@ async function executeTool(name, args) {
|
|
|
155
209
|
return parts.join('\n');
|
|
156
210
|
}
|
|
157
211
|
|
|
212
|
+
case 'create_knowledge': {
|
|
213
|
+
const data = await callApi('/knowledge', {
|
|
214
|
+
method: 'POST',
|
|
215
|
+
body: JSON.stringify({
|
|
216
|
+
title: args.title,
|
|
217
|
+
text_content: args.text_content,
|
|
218
|
+
category: args.category || 'other',
|
|
219
|
+
folder_id: args.folder_id,
|
|
220
|
+
}),
|
|
221
|
+
});
|
|
222
|
+
return `✅ ${data.message}\nID: ${data.id}\nタイトル: ${data.title}\nカテゴリ: ${data.category}\n作成日時: ${data.created_at}`;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
case 'update_knowledge': {
|
|
226
|
+
const body = {};
|
|
227
|
+
if (args.title) body.title = args.title;
|
|
228
|
+
if (args.text_content) body.text_content = args.text_content;
|
|
229
|
+
if (args.category) body.category = args.category;
|
|
230
|
+
const data = await callApi(`/knowledge/${args.id}`, {
|
|
231
|
+
method: 'PATCH',
|
|
232
|
+
body: JSON.stringify(body),
|
|
233
|
+
});
|
|
234
|
+
return `✅ ${data.message}\nID: ${data.id}\nタイトル: ${data.title}\n更新日時: ${data.updated_at}`;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
case 'delete_knowledge': {
|
|
238
|
+
const data = await callApi(`/knowledge/${args.id}`, { method: 'DELETE' });
|
|
239
|
+
return `✅ ${data.message}\n削除したナレッジ: ${data.deleted.title} (ID: ${data.deleted.id})`;
|
|
240
|
+
}
|
|
241
|
+
|
|
158
242
|
default:
|
|
159
243
|
throw new Error(`Unknown tool: ${name}`);
|
|
160
244
|
}
|
|
@@ -163,7 +247,7 @@ async function executeTool(name, args) {
|
|
|
163
247
|
// ── MCPサーバー起動 ────────────────────────────────────────────
|
|
164
248
|
async function main() {
|
|
165
249
|
const server = new Server(
|
|
166
|
-
{ name: 'owner-clone-ai', version: '1.
|
|
250
|
+
{ name: 'owner-clone-ai', version: '1.1.0' },
|
|
167
251
|
{ capabilities: { tools: {} } }
|
|
168
252
|
);
|
|
169
253
|
|