dingtalk-mcp 1.0.4 → 1.0.6

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.
@@ -397,18 +397,32 @@ export class DingTalkMCPServer {
397
397
  return;
398
398
  }
399
399
 
400
+ // 如果模型没有对应提参,则不赋值给API对应的入参
401
+ if (!args[arg.name]) {
402
+ return;
403
+ }
400
404
  //Object类型参数,递归处理
401
405
  let objParmas = arg.name.split('.');
402
406
  if (objParmas && objParmas.length > 1) {
403
407
  if (objParmas.length == 2){
408
+ if (!body[objParmas[0]]){
409
+ body[objParmas[0]] = {};
410
+ }
404
411
  body[objParmas[0]][objParmas[1]] = args[arg.name];
405
412
  }
406
413
  if (objParmas.length == 3){
414
+ if (!body[objParmas[0]]){
415
+ body[objParmas[0]] = {};
416
+ }
417
+ if (!body[objParmas[1]]){
418
+ body[objParmas[1]] = {};
419
+ }
407
420
  body[objParmas[0]][objParmas[1]][objParmas[2]] = args[arg.name];
408
421
  }
409
- return;
422
+ return;
410
423
  }
411
424
 
425
+
412
426
  // userIds参数直接传递为数组类型,保证请求体为正确的JSON对象
413
427
  if (arg.name === 'userIds' && Array.isArray(args[arg.name])) {
414
428
  body[arg.name] = args[arg.name];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dingtalk-mcp",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "DingTalk MCP Server - A TypeScript-based MCP server for DingTalk integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",