chaimi-bookkeeping-mcp 2.3.10 → 2.4.0
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 +10 -14
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -86,6 +86,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
86
86
|
amount: { type: 'number', description: '金额(必填)' },
|
|
87
87
|
category: { type: 'string', description: '分类(可选,如:餐饮、食品、交通)' },
|
|
88
88
|
store: { type: 'string', description: '商家名称(可选)' },
|
|
89
|
+
date: { type: 'string', description: '消费时间(ISO格式)(可选)' },
|
|
89
90
|
note: { type: 'string', description: '备注(可选)' },
|
|
90
91
|
agentType: { type: 'string', description: '【推荐自动填充】Agent类型,如:claude-desktop、cursor、openclaw、workbuddy、trae' },
|
|
91
92
|
apiProvider: { type: 'string', description: '【推荐自动填充】AI服务提供商,如:anthropic、openai、doubao、aliyun' },
|
|
@@ -179,6 +180,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
179
180
|
amount: { type: 'number', description: '收入金额' },
|
|
180
181
|
category: { type: 'string', description: '收入分类(如:工资、奖金、投资)' },
|
|
181
182
|
store: { type: 'string', description: '付款方(如:公司名称)' },
|
|
183
|
+
date: { type: 'string', description: '收入时间(ISO格式)(可选)' },
|
|
182
184
|
note: { type: 'string', description: '备注' },
|
|
183
185
|
agentType: { type: 'string', description: '【推荐自动填充】Agent类型,如:claude-desktop、cursor、openclaw、workbuddy、trae' },
|
|
184
186
|
apiProvider: { type: 'string', description: '【推荐自动填充】AI服务提供商,如:anthropic、openai、doubao、aliyun' },
|
|
@@ -300,7 +302,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
300
302
|
try {
|
|
301
303
|
const token = await getToken();
|
|
302
304
|
|
|
303
|
-
|
|
305
|
+
let processedArgs = { ...args };
|
|
304
306
|
if (processedArgs.items && typeof processedArgs.items === 'string') {
|
|
305
307
|
try {
|
|
306
308
|
processedArgs.items = JSON.parse(processedArgs.items);
|
|
@@ -351,19 +353,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
351
353
|
);
|
|
352
354
|
|
|
353
355
|
if (fillResult.success) {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
if (savedAgentType) {
|
|
359
|
-
processedArgs.agentType = savedAgentType;
|
|
360
|
-
}
|
|
361
|
-
if (savedApiProvider) {
|
|
362
|
-
processedArgs.apiProvider = savedApiProvider;
|
|
363
|
-
}
|
|
364
|
-
if (savedRawInput) {
|
|
365
|
-
processedArgs.rawInput = savedRawInput;
|
|
366
|
-
}
|
|
356
|
+
processedArgs = {
|
|
357
|
+
...fillResult.data,
|
|
358
|
+
...processedArgs
|
|
359
|
+
};
|
|
367
360
|
}
|
|
368
361
|
}
|
|
369
362
|
|
|
@@ -523,6 +516,7 @@ function convertParams(toolName, args) {
|
|
|
523
516
|
quantity: 1,
|
|
524
517
|
category: sanitizeString(args.category, 50) || '其他',
|
|
525
518
|
store: sanitizeString(args.store, 100) || '',
|
|
519
|
+
date: args.date,
|
|
526
520
|
transactionType: 'expense',
|
|
527
521
|
unit: '',
|
|
528
522
|
weight: '',
|
|
@@ -581,6 +575,7 @@ function convertParams(toolName, args) {
|
|
|
581
575
|
memberCardNo: sanitizeString(args.memberCardNo, 50),
|
|
582
576
|
currentPoints: parseInt(args.currentPoints) || 0,
|
|
583
577
|
totalPoints: parseInt(args.totalPoints) || 0,
|
|
578
|
+
date: args.date,
|
|
584
579
|
rawInput: sanitizeString(args.rawInput, 2000),
|
|
585
580
|
agentType: args.agentType || '',
|
|
586
581
|
apiProvider: args.apiProvider || '',
|
|
@@ -608,6 +603,7 @@ function convertParams(toolName, args) {
|
|
|
608
603
|
amount: validateAmount(args.amount),
|
|
609
604
|
category: sanitizeString(args.category, 50) || '其他',
|
|
610
605
|
store: sanitizeString(args.store, 100),
|
|
606
|
+
date: args.date,
|
|
611
607
|
note: sanitizeString(args.note, 500),
|
|
612
608
|
transactionType: 'income',
|
|
613
609
|
rawInput: sanitizeString(args.rawInput, 1000),
|