chaimi-bookkeeping-mcp 2.4.0 → 2.4.2

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 +8 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-bookkeeping-mcp",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "柴米记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -333,8 +333,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
333
333
  }
334
334
 
335
335
  case 'save_receipt': {
336
- const validationResult = await callMcpPrompt(
337
- 'validateResult',
336
+ // 总是调用 fillDefaults 来补充默认值(包括 actualAmount 等字段)
337
+ const fillResult = await callMcpPrompt(
338
+ 'fillDefaults',
338
339
  {
339
340
  data: processedArgs,
340
341
  type: 'parseReceipt'
@@ -342,22 +343,11 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
342
343
  token
343
344
  );
344
345
 
345
- if (validationResult.success && !validationResult.data.valid) {
346
- const fillResult = await callMcpPrompt(
347
- 'fillDefaults',
348
- {
349
- data: processedArgs,
350
- type: 'parseReceipt'
351
- },
352
- token
353
- );
354
-
355
- if (fillResult.success) {
356
- processedArgs = {
357
- ...fillResult.data,
358
- ...processedArgs
359
- };
360
- }
346
+ if (fillResult.success) {
347
+ processedArgs = {
348
+ ...fillResult.data,
349
+ ...processedArgs
350
+ };
361
351
  }
362
352
 
363
353
  const mcpParams = convertParams('save_receipt', processedArgs);