note-mcp-server 2.4.2 → 2.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.
- package/index.js +35 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -192,6 +192,16 @@ function buildNoteUrl(cId) {
|
|
|
192
192
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
193
193
|
return {
|
|
194
194
|
tools: [
|
|
195
|
+
{
|
|
196
|
+
name: "block_list",
|
|
197
|
+
description: withSecurityNotice(
|
|
198
|
+
`列出 ${APP_NAME} 中當前用戶有權限建立內容的所有區塊(看板/筆記本等)。回傳的資料會包含每個區塊的名稱與可用的狀態標籤 (tags)。如果該區塊有設定狀態標籤(例如用於 Kanban 或是 Defect Flow),請在安排工作流程或建立內容時參考這些可用的標籤;若無狀態標籤,則通常為單純的 CMS 或企業知識庫,直接新增內容即可。回傳的 b_id 可用於 create_note 建立內容到指定看板。`
|
|
199
|
+
),
|
|
200
|
+
inputSchema: {
|
|
201
|
+
type: "object",
|
|
202
|
+
properties: {},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
195
205
|
{
|
|
196
206
|
name: "list_notes",
|
|
197
207
|
description: withSecurityNotice(
|
|
@@ -227,18 +237,19 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
227
237
|
name: "create_note",
|
|
228
238
|
description: withCardGuide(
|
|
229
239
|
withSecurityNotice(
|
|
230
|
-
`在 ${APP_NAME}
|
|
240
|
+
`在 ${APP_NAME} 中新增筆記。未指定任何 b_id 的情況下,代表就是新增至「我的筆記」預設值。內容請優先使用 AdminLTE 4 可摺疊 card(見下方結構)。\nAI 行為:\n1. 除非用戶明確要求,否則不要傳 tags(勿自行推測、分類或補加標籤)。\n2. 若用戶僅提供區塊名稱(例如「看板」)而未提供 b_id,請先呼叫 block_list 查詢。若只有一個相符的名稱,直接使用該 b_id 建立;若有多個相符名稱,請列出選項並詢問用戶要加到哪一個 b_id。`
|
|
231
241
|
)
|
|
232
242
|
),
|
|
233
243
|
inputSchema: {
|
|
234
244
|
type: "object",
|
|
235
245
|
properties: {
|
|
246
|
+
b_id: { type: "number", description: "指定要建立的區塊 ID(可選,預設為個人筆記本)。可先用 block_list 查詢可用的 b_id" },
|
|
236
247
|
content: { type: "string", description: "HTML 或純文字內容" },
|
|
237
248
|
title: { type: "string", description: "標題(可選)" },
|
|
238
249
|
tags: {
|
|
239
250
|
type: "string",
|
|
240
251
|
description:
|
|
241
|
-
"
|
|
252
|
+
"標籤,多個以逗號分隔(可選;若指定 b_id 且該區塊有必填標籤時,不傳則會自動補上預設狀態標籤)",
|
|
242
253
|
},
|
|
243
254
|
},
|
|
244
255
|
required: ["content"],
|
|
@@ -254,6 +265,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
254
265
|
inputSchema: {
|
|
255
266
|
type: "object",
|
|
256
267
|
properties: {
|
|
268
|
+
b_id: { type: "number", description: "移動到指定的區塊 ID(可選)" },
|
|
257
269
|
c_id: { type: "number", description: "筆記 ID" },
|
|
258
270
|
content: { type: "string", description: "新內容(可選,若未傳則使用現有內容作為基底)" },
|
|
259
271
|
title: {
|
|
@@ -346,6 +358,21 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
346
358
|
|
|
347
359
|
try {
|
|
348
360
|
switch (name) {
|
|
361
|
+
case "block_list": {
|
|
362
|
+
const response = await axios.get(BASE_URL, {
|
|
363
|
+
params: { action: "list_blocks" },
|
|
364
|
+
});
|
|
365
|
+
const payload =
|
|
366
|
+
response.data && typeof response.data === "object"
|
|
367
|
+
? { ...response.data }
|
|
368
|
+
: response.data;
|
|
369
|
+
return {
|
|
370
|
+
content: [
|
|
371
|
+
{ type: "text", text: JSON.stringify(payload, null, 2) },
|
|
372
|
+
],
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
|
|
349
376
|
case "list_notes": {
|
|
350
377
|
const params = {};
|
|
351
378
|
if (args.search) params.search = args.search;
|
|
@@ -396,6 +423,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
396
423
|
|
|
397
424
|
case "create_note": {
|
|
398
425
|
const payload = { content: args.content };
|
|
426
|
+
if (args.b_id !== undefined && args.b_id !== null) {
|
|
427
|
+
payload.b_id = Number(args.b_id);
|
|
428
|
+
}
|
|
399
429
|
if (args.title !== undefined && args.title !== "") {
|
|
400
430
|
payload.title = args.title;
|
|
401
431
|
}
|
|
@@ -416,6 +446,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
416
446
|
const payload = {
|
|
417
447
|
c_id: Number(args.c_id),
|
|
418
448
|
};
|
|
449
|
+
if (args.b_id !== undefined && args.b_id !== null) {
|
|
450
|
+
payload.b_id = Number(args.b_id);
|
|
451
|
+
}
|
|
419
452
|
if (args.content !== undefined) {
|
|
420
453
|
payload.content = args.content;
|
|
421
454
|
}
|
package/package.json
CHANGED