chaimi-keep-mcp 3.1.43 → 3.1.44-beta.1
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/package.json +1 -1
- package/server.js +21 -10
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -320,6 +320,17 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
320
320
|
required: ['name', 'amount', 'category', 'agentType', 'apiProvider', 'rawInput'],
|
|
321
321
|
},
|
|
322
322
|
},
|
|
323
|
+
{
|
|
324
|
+
name: 'get_text_parse_prompt',
|
|
325
|
+
description: '获取文字记账解析的Prompt模板,用于指导大模型如何解析用户输入的记账文字。返回的Prompt应作为system message,配合用户输入的记账文字作为user message调用大模型',
|
|
326
|
+
inputSchema: {
|
|
327
|
+
type: 'object',
|
|
328
|
+
properties: {
|
|
329
|
+
agentType: { type: 'string', description: '【推荐自动填充】Agent类型,如:claude-desktop、cursor、openclaw、workbuddy、trae' },
|
|
330
|
+
apiProvider: { type: 'string', description: '【推荐自动填充】AI服务提供商,如:anthropic、openai、doubao、aliyun' },
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
},
|
|
323
334
|
{
|
|
324
335
|
name: 'get_parse_prompt',
|
|
325
336
|
description: '获取小票图片解析的Prompt模板,用于指导大模型如何格式化输出小票信息。返回的Prompt应作为system message,配合小票图片作为user message调用大模型',
|
|
@@ -1357,23 +1368,23 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1357
1368
|
}
|
|
1358
1369
|
|
|
1359
1370
|
case 'get_text_parse_prompt': {
|
|
1360
|
-
//
|
|
1361
|
-
const
|
|
1371
|
+
// 调用 mcpPrompt 云函数获取文字记账解析 Prompt
|
|
1372
|
+
const promptResult = await callMcpPrompt('getTextParsePrompt', {}, token);
|
|
1362
1373
|
|
|
1363
|
-
if (
|
|
1374
|
+
if (promptResult.success) {
|
|
1364
1375
|
result = {
|
|
1365
1376
|
success: true,
|
|
1366
1377
|
data: {
|
|
1367
|
-
prompt:
|
|
1368
|
-
currentDate:
|
|
1369
|
-
currentTime:
|
|
1370
|
-
instructions:
|
|
1378
|
+
prompt: promptResult.data.prompt,
|
|
1379
|
+
currentDate: promptResult.data.currentDate,
|
|
1380
|
+
currentTime: promptResult.data.currentTime,
|
|
1381
|
+
instructions: promptResult.data.instructions
|
|
1371
1382
|
}
|
|
1372
1383
|
};
|
|
1373
|
-
userMessage = `✅ 获取文字记账解析 Prompt 成功\n\n当前日期: ${
|
|
1384
|
+
userMessage = `✅ 获取文字记账解析 Prompt 成功\n\n当前日期: ${promptResult.data.currentDate}\n当前时间: ${promptResult.data.currentTime}\n\n## Prompt\n\n请将以下内容作为 system message 发送给大模型:\n\n\`\`\`\n${promptResult.data.prompt}\n\`\`\`\n\n## 使用说明\n\n1. 将上面的 Prompt 作为 system message\n2. 将用户输入的记账文字(如"午餐 24块")作为 user message\n3. 调用大模型解析,获取 JSON 结果\n4. 解析完成后,调用 save_expense 或 save_income 工具保存结果`;
|
|
1374
1385
|
} else {
|
|
1375
|
-
result = { success: false, error:
|
|
1376
|
-
userMessage = `❌ 获取文字记账解析 Prompt 失败:${
|
|
1386
|
+
result = { success: false, error: promptResult.error };
|
|
1387
|
+
userMessage = `❌ 获取文字记账解析 Prompt 失败:${promptResult.error}`;
|
|
1377
1388
|
}
|
|
1378
1389
|
break;
|
|
1379
1390
|
}
|