chaimi-bookkeeping-mcp 2.4.2 → 2.4.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/package.json +1 -1
- package/server.js +21 -1
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -333,7 +333,27 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
case 'save_receipt': {
|
|
336
|
-
//
|
|
336
|
+
// 1. 调用 parseReceipt 重新提取小票信息(覆盖 Agent 传的数据)
|
|
337
|
+
if (processedArgs.rawInput) {
|
|
338
|
+
const parseResult = await callMcpPrompt(
|
|
339
|
+
'parseReceipt',
|
|
340
|
+
{
|
|
341
|
+
text: processedArgs.rawInput,
|
|
342
|
+
type: 'parseReceipt'
|
|
343
|
+
},
|
|
344
|
+
token
|
|
345
|
+
);
|
|
346
|
+
|
|
347
|
+
if (parseResult.success && parseResult.data) {
|
|
348
|
+
// 用 parseReceipt 提取的信息覆盖 Agent 传的参数
|
|
349
|
+
processedArgs = {
|
|
350
|
+
...processedArgs,
|
|
351
|
+
...parseResult.data
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// 2. 调用 fillDefaults 补充默认值
|
|
337
357
|
const fillResult = await callMcpPrompt(
|
|
338
358
|
'fillDefaults',
|
|
339
359
|
{
|