note-mcp-server 2.2.3 → 2.2.4
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 +14 -17
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -76,7 +76,7 @@ const APP_NAME = firstEnv("app_name", "APP_NAME", "notes_app_name", "NOTES_APP_N
|
|
|
76
76
|
const server = new Server(
|
|
77
77
|
{
|
|
78
78
|
name: `note-mcp-server (${APP_NAME})`,
|
|
79
|
-
version: "2.2.
|
|
79
|
+
version: "2.2.4",
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
capabilities: {
|
|
@@ -114,19 +114,14 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
114
114
|
tools: [
|
|
115
115
|
{
|
|
116
116
|
name: "list_notes",
|
|
117
|
-
description:
|
|
117
|
+
description: `列出或搜尋 ${APP_NAME} 中的筆記。支援關鍵字、標籤搜尋及分頁(預設每頁 10 筆)。`,
|
|
118
118
|
inputSchema: {
|
|
119
119
|
type: "object",
|
|
120
120
|
properties: {
|
|
121
|
-
search: {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
limit: {
|
|
126
|
-
type: "number",
|
|
127
|
-
description: "最多回傳幾筆(預設 3)",
|
|
128
|
-
default: 3,
|
|
129
|
-
},
|
|
121
|
+
search: { type: "string", description: "搜尋關鍵字(可選)" },
|
|
122
|
+
tag: { type: "string", description: "搜尋標籤(可選,例如:打卡機)" },
|
|
123
|
+
page: { type: "number", description: "頁碼(可選,預設 1)" },
|
|
124
|
+
limit: { type: "number", description: "每頁幾筆(可選,預設 10)" },
|
|
130
125
|
},
|
|
131
126
|
},
|
|
132
127
|
},
|
|
@@ -227,15 +222,17 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
227
222
|
try {
|
|
228
223
|
switch (name) {
|
|
229
224
|
case "list_notes": {
|
|
230
|
-
const limit = Number(args.limit) > 0 ? Number(args.limit) : 3;
|
|
231
225
|
const params = {};
|
|
232
|
-
if (args.search)
|
|
233
|
-
|
|
234
|
-
|
|
226
|
+
if (args.search) params.search = args.search;
|
|
227
|
+
if (args.tag) params.tag = args.tag;
|
|
228
|
+
if (args.page) params.page = args.page;
|
|
229
|
+
params.limit = args.limit || 10;
|
|
230
|
+
|
|
235
231
|
const response = await axios.get(BASE_URL, { params });
|
|
236
|
-
const list = normalizeListPayload(response.data).slice(0, limit);
|
|
237
232
|
return {
|
|
238
|
-
content: [
|
|
233
|
+
content: [
|
|
234
|
+
{ type: "text", text: JSON.stringify(response.data, null, 2) },
|
|
235
|
+
],
|
|
239
236
|
};
|
|
240
237
|
}
|
|
241
238
|
|
package/package.json
CHANGED