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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +21 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-keep-mcp",
3
- "version": "3.1.43",
3
+ "version": "3.1.44-beta.1",
4
4
  "description": "柴米记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {
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
- // 获取文字记账解析 Prompt
1361
- const textParseResult = await callMcpHubWithLogging('getTextParsePrompt', {}, token, traceId, startTime, osInfo);
1371
+ // 调用 mcpPrompt 云函数获取文字记账解析 Prompt
1372
+ const promptResult = await callMcpPrompt('getTextParsePrompt', {}, token);
1362
1373
 
1363
- if (textParseResult.success) {
1374
+ if (promptResult.success) {
1364
1375
  result = {
1365
1376
  success: true,
1366
1377
  data: {
1367
- prompt: textParseResult.data.prompt,
1368
- currentDate: textParseResult.data.currentDate,
1369
- currentTime: textParseResult.data.currentTime,
1370
- instructions: '请将返回的 prompt 作为 system message,把用户输入的记账文字作为 user message,调用大模型解析。解析完成后,调用 save_expense 或 save_income 工具保存结果。'
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当前日期: ${textParseResult.data.currentDate}\n当前时间: ${textParseResult.data.currentTime}\n\n## Prompt\n\n请将以下内容作为 system message 发送给大模型:\n\n\`\`\`\n${textParseResult.data.prompt}\n\`\`\`\n\n## 使用说明\n\n1. 将上面的 Prompt 作为 system message\n2. 将用户输入的记账文字(如"午餐 24块")作为 user message\n3. 调用大模型解析,获取 JSON 结果\n4. 解析完成后,调用 save_expense 或 save_income 工具保存结果\n\n## 解析结果示例\n\n\`\`\`json\n{\n "name": "午餐",\n "amount": 24,\n "category": "餐饮",\n "datetime": "2026-04-14T12:30:00+08:00",\n "transactionType": "expense"\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: textParseResult.error };
1376
- userMessage = `❌ 获取文字记账解析 Prompt 失败:${textParseResult.error}`;
1386
+ result = { success: false, error: promptResult.error };
1387
+ userMessage = `❌ 获取文字记账解析 Prompt 失败:${promptResult.error}`;
1377
1388
  }
1378
1389
  break;
1379
1390
  }