dingtalk-mcp 1.1.10 → 1.1.15
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/dingtalk_contacts_mcp_server.yaml +2 -2
- package/dingtalk_notable_mcp_server.yaml +136 -9
- package/dist/resources/notable-field-property.md +12 -12
- package/dist/resources/notable-field-search-filters.md +11 -0
- package/dist/resources/notable-record-values.md +12 -12
- package/dist/utils/localTools.js +2 -2
- package/package.json +2 -1
|
@@ -9,10 +9,10 @@ server:
|
|
|
9
9
|
name: x-acs-dingtalk-access-token
|
|
10
10
|
tools:
|
|
11
11
|
- name: currentDateTime
|
|
12
|
-
description:
|
|
12
|
+
description: 获取当前日期和时间
|
|
13
13
|
|
|
14
14
|
- name: searchUser
|
|
15
|
-
description:
|
|
15
|
+
description: 根据姓名搜索钉钉通讯录用户的userId。
|
|
16
16
|
args:
|
|
17
17
|
- name: queryWord
|
|
18
18
|
description: 搜索关键词,可以是用户姓名、姓名拼音或英文名称。
|
|
@@ -2,6 +2,12 @@ server:
|
|
|
2
2
|
name: dingtalk-notable
|
|
3
3
|
description: 钉钉AI表格/多维表
|
|
4
4
|
tools:
|
|
5
|
+
- name: notableSupportedSearchFilters
|
|
6
|
+
description: AI表格/多维表支持的搜索过滤条件
|
|
7
|
+
requestTemplate:
|
|
8
|
+
type: file
|
|
9
|
+
url: /resources/notable-field-search-filters.md
|
|
10
|
+
|
|
5
11
|
- name: notableSupportedFieldInfo
|
|
6
12
|
description: AI表格/多维表支持的字段类型和额外属性
|
|
7
13
|
requestTemplate:
|
|
@@ -22,7 +28,7 @@ tools:
|
|
|
22
28
|
url: https://api.dingtalk.com/v2.0/storage/dentries/search?operatorId=String
|
|
23
29
|
args:
|
|
24
30
|
- name: operatorId
|
|
25
|
-
description: 操作人的unionId
|
|
31
|
+
description: 操作人的unionId,如果找不到,可以从通讯录相关Tool中获取。
|
|
26
32
|
type: string
|
|
27
33
|
required: true
|
|
28
34
|
position: query
|
|
@@ -61,7 +67,7 @@ tools:
|
|
|
61
67
|
description: 分页大小,默认值10
|
|
62
68
|
# 数据表
|
|
63
69
|
- name: getNotableSheet
|
|
64
|
-
description: 获取AI
|
|
70
|
+
description: 获取AI表格/多维表的单个数据表的ID和名称
|
|
65
71
|
requestTemplate:
|
|
66
72
|
method: GET
|
|
67
73
|
url: https://api.dingtalk.com/v1.0/notable/bases/{baseId}/sheets/{sheetIdOrName}?operatorId=String
|
|
@@ -244,8 +250,10 @@ tools:
|
|
|
244
250
|
type: string
|
|
245
251
|
description: 条件类型:equal | notEqual | greater | greaterEqual | less | lessEqual | contain | notContain | empty | notEmpty。
|
|
246
252
|
value:
|
|
247
|
-
type:
|
|
248
|
-
description:
|
|
253
|
+
type: array
|
|
254
|
+
description: 字段值,必须是数组类型,格式需要参考「notableSupportedSearchFilters」说明。
|
|
255
|
+
items:
|
|
256
|
+
type: any
|
|
249
257
|
required:
|
|
250
258
|
- field
|
|
251
259
|
- operator
|
|
@@ -339,9 +347,64 @@ tools:
|
|
|
339
347
|
properties:
|
|
340
348
|
fields:
|
|
341
349
|
type: object
|
|
342
|
-
description:
|
|
343
|
-
|
|
344
|
-
|
|
350
|
+
description: |
|
|
351
|
+
字段键值对,key为字段ID或名称,value为字段设置值,格式需参考「notableRecordValuesFormat」Tool的结果。
|
|
352
|
+
参考如下结构图:
|
|
353
|
+
"fields":{
|
|
354
|
+
"人员2":[
|
|
355
|
+
{
|
|
356
|
+
unionId: "oEoTOxbGV6o7AiSB5RcfrTAiEiE"
|
|
357
|
+
}
|
|
358
|
+
],
|
|
359
|
+
"标题": "name"
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
- name: updateNotableRecords
|
|
363
|
+
description: 更新AI表格/多维表里指定数据表的多行记录
|
|
364
|
+
requestTemplate:
|
|
365
|
+
method: PUT
|
|
366
|
+
url: https://api.dingtalk.com/v1.0/notable/bases/{baseId}/sheets/{sheetIdOrName}/records?operatorId=String
|
|
367
|
+
args:
|
|
368
|
+
- name: operatorId
|
|
369
|
+
description: 操作人的unionId
|
|
370
|
+
type: string
|
|
371
|
+
required: true
|
|
372
|
+
position: query
|
|
373
|
+
- name: baseId
|
|
374
|
+
description: AI表格/多维表ID,从「根据名称查询AI表格/多维表」Tool中的结果字段「dentryUuid」获取。
|
|
375
|
+
type: string
|
|
376
|
+
required: true
|
|
377
|
+
position: path
|
|
378
|
+
- name: sheetIdOrName
|
|
379
|
+
description: 数据表ID或数据表名称。数据表ID可以通过调用「getNotableAllSheets」获取
|
|
380
|
+
type: string
|
|
381
|
+
required: true
|
|
382
|
+
position: path
|
|
383
|
+
- name: records
|
|
384
|
+
description: 记录数组,每个记录包含id和fields字段
|
|
385
|
+
type: array
|
|
386
|
+
required: true
|
|
387
|
+
position: body
|
|
388
|
+
items:
|
|
389
|
+
type: object
|
|
390
|
+
properties:
|
|
391
|
+
id:
|
|
392
|
+
type: string
|
|
393
|
+
description: 记录ID
|
|
394
|
+
fields:
|
|
395
|
+
type: object
|
|
396
|
+
description: |
|
|
397
|
+
字段键值对,key为字段ID,value为字段设置值,格式需参考「notableRecordValuesFormat」Tool的结果。
|
|
398
|
+
参考如下结构图:
|
|
399
|
+
"fields":{
|
|
400
|
+
"人员2":[
|
|
401
|
+
{
|
|
402
|
+
unionId: "oEoTOxbGV6o7AiSB5RcfrTAiEiE"
|
|
403
|
+
}
|
|
404
|
+
],
|
|
405
|
+
"标题": "name"
|
|
406
|
+
}
|
|
407
|
+
|
|
345
408
|
|
|
346
409
|
# 字段
|
|
347
410
|
- name: getNotableAllFields
|
|
@@ -393,7 +456,7 @@ tools:
|
|
|
393
456
|
required: true
|
|
394
457
|
position: body
|
|
395
458
|
- name: type
|
|
396
|
-
description: 字段类型,需要参考「notableSupportedFieldInfo」Tool
|
|
459
|
+
description: 字段类型,需要参考「notableSupportedFieldInfo」Tool的对不同类型字段的类型描述。
|
|
397
460
|
type: string
|
|
398
461
|
required: true
|
|
399
462
|
position: body
|
|
@@ -401,4 +464,68 @@ tools:
|
|
|
401
464
|
description: 字段属性,,需要参考「notableSupportedFieldInfo」Tool的对不同类型字段的属性描述。
|
|
402
465
|
type: object
|
|
403
466
|
required: false
|
|
404
|
-
position: body
|
|
467
|
+
position: body
|
|
468
|
+
|
|
469
|
+
- name: deleteNotableField
|
|
470
|
+
description: 删除AI表格/多维表里指定数据表的字段
|
|
471
|
+
requestTemplate:
|
|
472
|
+
method: DELETE
|
|
473
|
+
url: https://api.dingtalk.com/v1.0/notable/bases/{baseId}/sheets/{sheetIdOrName}/fields/{fieldIdOrName}?operatorId=String
|
|
474
|
+
args:
|
|
475
|
+
- name: operatorId
|
|
476
|
+
description: 操作人的unionId
|
|
477
|
+
type: string
|
|
478
|
+
required: true
|
|
479
|
+
position: query
|
|
480
|
+
- name: baseId
|
|
481
|
+
description: AI表格/多维表ID,从「根据名称查询AI表格/多维表」Tool中的结果字段「dentryUuid」获取。
|
|
482
|
+
type: string
|
|
483
|
+
required: true
|
|
484
|
+
position: path
|
|
485
|
+
- name: sheetIdOrName
|
|
486
|
+
description: 数据表ID或数据表名称。数据表ID可以通过调用「getNotableAllSheets」获取
|
|
487
|
+
type: string
|
|
488
|
+
required: true
|
|
489
|
+
position: path
|
|
490
|
+
- name: fieldIdOrName
|
|
491
|
+
description: 字段ID或字段名称
|
|
492
|
+
type: string
|
|
493
|
+
required: true
|
|
494
|
+
position: path
|
|
495
|
+
|
|
496
|
+
- name: updateNotableField
|
|
497
|
+
description: 更新AI表格/多维表里指定数据表的字段,建议先从「getNotableAllFields」Tool中获取要更新字段的类型。
|
|
498
|
+
requestTemplate:
|
|
499
|
+
method: PUT
|
|
500
|
+
url: https://api.dingtalk.com/v1.0/notable/bases/{baseId}/sheets/{sheetIdOrName}/fields/{fieldIdOrName}?operatorId=String
|
|
501
|
+
args:
|
|
502
|
+
- name: operatorId
|
|
503
|
+
description: 操作人的unionId
|
|
504
|
+
type: string
|
|
505
|
+
required: true
|
|
506
|
+
position: query
|
|
507
|
+
- name: baseId
|
|
508
|
+
description: AI表格/多维表ID,从「根据名称查询AI表格/多维表」Tool中的结果字段「dentryUuid」获取。
|
|
509
|
+
type: string
|
|
510
|
+
required: true
|
|
511
|
+
position: path
|
|
512
|
+
- name: sheetIdOrName
|
|
513
|
+
description: 数据表ID或数据表名称。数据表ID可以通过调用「getNotableAllSheets」获取
|
|
514
|
+
type: string
|
|
515
|
+
required: true
|
|
516
|
+
position: path
|
|
517
|
+
- name: fieldIdOrName
|
|
518
|
+
description: 字段ID或字段名称
|
|
519
|
+
type: string
|
|
520
|
+
required: true
|
|
521
|
+
position: path
|
|
522
|
+
- name: name
|
|
523
|
+
description: 字段名称
|
|
524
|
+
type: string
|
|
525
|
+
required: true
|
|
526
|
+
position: body
|
|
527
|
+
- name: property
|
|
528
|
+
description: 字段属性,需要参考「notableSupportedFieldInfo」Tool的对不同类型字段的属性描述。
|
|
529
|
+
type: object
|
|
530
|
+
required: false
|
|
531
|
+
position: body
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
该文档介绍了AI表格中字段属性的相关配置。
|
|
4
4
|
|
|
5
|
-
| 字段名 | 类型 (type) | 属性 (property)
|
|
6
|
-
| --- | ---
|
|
7
|
-
| 文本 | text | 无
|
|
5
|
+
| 字段名 | 类型 (type) | 属性 (property) |
|
|
6
|
+
| --- | --- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
7
|
+
| 文本 | text | 无 |
|
|
8
8
|
| 数字 | number | ``` { formatter: "INT" // 整数 \| "FLOAT_1" // 保留1位小数 \| "FLOAT_2" // 保留2位小数 \| "FLOAT_3" // 保留3位小数 \| "FLOAT_4" // 保留4位小数 \| "THOUSAND" // 千分位 \| "THOUSAND_FLOAT" // 千分位(小数点) \| "PRESENT" // 百分比 \| "PRESENT_FLOAT" // 百分比(小数点) \| "CNY" // 人民币 \| "CNY_FLOAT" // 人民币(小数点) \| "HKD" // 港元 \| "HKD_FLOAT" // 港元(小数点) \| "USD" // 美元 \| "USD_FLOAT" // 美元(小数点) \| "EUR" // 欧元 \| "EUR_FLOAT" // 欧元(小数点) \| "JPY" // 日元 \| "JPY_FLOAT"; // 日元(小数点) } ``` |
|
|
9
|
-
| 单选 | singleSelect | ``` { choices: [{ name: "optionName1" // 配置选项名 }, { name: "optionName2" }]; } ```
|
|
10
|
-
| 多选 | multipleSelect | 同「单选」
|
|
11
|
-
| 日期 | date | ``` { formatter: "YYYY-MM-DD" // 显示格式: 2023-12-31 \| "YYYY-MM-DD HH:mm" // 显示格式: 2023-12-31 09:00
|
|
12
|
-
| 人员 | user | ``` { multiple: boolean; // 支持多选,默认为true } ```
|
|
13
|
-
| 部门 | department | ``` { multiple: boolean; // 支持多选,默认为true } ```
|
|
14
|
-
| 附件 | attachment | 无
|
|
15
|
-
| 单向关联 | unidirectionalLink | ``` { multiple: boolean; // 支持多选,默认为true linkedSheetId: "xxx" // 关联的数据表ID } ```
|
|
16
|
-
| 双向关联 | bidirectionalLink | ``` { multiple: boolean; // 支持多选,默认为true linkedSheetId: "xxx", // 关联的数据表ID linkedFieldId: "yyy" // 关联的数据表上的字段ID,创建字段时不传 } ```
|
|
17
|
-
| 链接 | url | 无
|
|
9
|
+
| 单选 | singleSelect | ``` { choices: [{ name: "optionName1" // 配置选项名 }, { name: "optionName2" }]; } ``` |
|
|
10
|
+
| 多选 | multipleSelect | 同「单选」 |
|
|
11
|
+
| 日期 | date | ``` { formatter: "YYYY-MM-DD" // 显示格式: 2023-12-31 \| "YYYY-MM-DD HH:mm" // 显示格式: 2023-12-31 09:00 \| "YYYY-MM-DD HH:mm:ss" // 显示格式: 2023-12-31 09:00:01 \| "YYYY/MM/DD" // 显示格式: 2023/12/31 \| "YYYY/MM/DD HH:mm"; // 显示格式: 2023/12/31 09:00 } ``` |
|
|
12
|
+
| 人员 | user | ``` { multiple: boolean; // 支持多选,默认为true } ``` |
|
|
13
|
+
| 部门 | department | ``` { multiple: boolean; // 支持多选,默认为true } ``` |
|
|
14
|
+
| 附件 | attachment | 无 |
|
|
15
|
+
| 单向关联 | unidirectionalLink | ``` { multiple: boolean; // 支持多选,默认为true linkedSheetId: "xxx" // 关联的数据表ID } ``` |
|
|
16
|
+
| 双向关联 | bidirectionalLink | ``` { multiple: boolean; // 支持多选,默认为true linkedSheetId: "xxx", // 关联的数据表ID linkedFieldId: "yyy" // 关联的数据表上的字段ID,创建字段时不传 } ``` |
|
|
17
|
+
| 链接 | url | 无 |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
**条件查询配置**
|
|
2
|
+
---------------------------
|
|
3
|
+
| **字段类型** | **可用操作符** | **查询条件值** |
|
|
4
|
+
|----------|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
5
|
+
| 文本 | equal \| notEqual \| contain \| notContain \| empty \| notEmpty | 示例:`["abc"]`<br/> operator 是 empty/notEmpty 时不需要传值。 |
|
|
6
|
+
| 数字 | equal \| notEqual \| greater \| greaterEqual \| less \| lessEqual \| empty \| notEmpty | 示例:`["123"]` <br/>operator 是 empty/notEmpty 时不需要传值。 |
|
|
7
|
+
| 单选 | equal \| notEqual \| contain \| notContain \| empty \| notEmpty | 示例: `["option1", "optionId2"]` <br/>operator 是 contain 时,包含 value 中的任何一个选项即满足条件。<br/>operator 是 notContain 时,不包含 value 中的所有选项即满足条件。<br/> operator 是 empty/notEmpty 时不需要传值。 |
|
|
8
|
+
| 多选 | 同「单选」 | 同「单选」 |
|
|
9
|
+
| 日期 | equal \| greater \| less \| empty \| notEmpty | 示例: `["2024-09-27"\| timestamp]` <br/>operator 是 empty/notEmpty 时不需要传值。 |
|
|
10
|
+
| 人员 | equal \| notEqual \| contain \| notContain \| empty \| notEmpty | 示例: `[{"unionId": "xxx"}, {"unionId": "yyy"}]`<br/>operator 是 contain 时,包含 value 中的任何一个选项即满足条件。<br/> operator 是 notContain 时,不包含 value 中的所有选项即满足条件。<br/>operator 是 empty/notEmpty 时不需要传值。 |
|
|
11
|
+
| 部门 | equal \| notEqual \| contain \| notContain \| empty \| notEmpty | 示例: `[{"deptId": "xxx"}, {"deptId": "yyy"}]`<br/>operator 是 contain 时,包含 value 中的任何一个选项即满足条件。<br/> operator 是 notContain 时,不包含 value 中的所有选项即满足条件。<br/>operator 是 empty/notEmpty 时不需要传值。 |
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
不同字段类型所使用的格式请参考下表:
|
|
5
5
|
|
|
6
6
|
| 字段名 | 类型 (type) | 设置值(新增/更新记录时使用的格式) | 返回值(返回记录值时返回的格式) |
|
|
7
|
-
| --- | ---
|
|
8
|
-
| 文本 | text | `"TextString" // 字符串`
|
|
9
|
-
| 数字 | number | `123 // 支持整数/浮点数/字符串`
|
|
10
|
-
| 单选 | singleSelect | `"optionName1" // 单选选项名`
|
|
11
|
-
| 多选 | multipleSelect | `["optionName1", "optionName2"] // 多选选项名`
|
|
12
|
-
| 日期 | date | `1688601600000 // 时间戳 "2023-12-20 03:00" // 或者 ISO 8601字符串`
|
|
13
|
-
| 人员 | user | `[ { unionId: "xxx" } ]`
|
|
14
|
-
| 部门 | department | `[ { deptId: "xxx" } ]`
|
|
15
|
-
| 附件 | attachment | 具体请参考[上传附件](https://open.dingtalk.com/document/orgapp/notable-upload-attachment) 。
|
|
16
|
-
| 单向关联 | unidirectionalLink | `{ "linkedRecordIds": [ "xxx", "yyy" ] }`
|
|
17
|
-
| 双向关联 | bidirectionalLink | `{ "linkedRecordIds": [ "xxx", "yyy" ] }`
|
|
18
|
-
| 链接 | url | `{ "text": "Dingtalk", "link": "https://dingtalk.com" }`
|
|
7
|
+
| --- | --- |------------------------------------------------------------------------------------|-------------------------------------------------------|
|
|
8
|
+
| 文本 | text | `"TextString" // 字符串` | `"TextString" // 字符串` |
|
|
9
|
+
| 数字 | number | `123 // 支持整数/浮点数/字符串` | `"123" // 数字值,以字符串形式返回` |
|
|
10
|
+
| 单选 | singleSelect | `"optionName1" // 单选选项名` | `{ "id": "id", // 选项ID "name": "optionName1" // 选项名 }` |
|
|
11
|
+
| 多选 | multipleSelect | `["optionName1", "optionName2"] // 多选选项名` | `[ { "id": "id1", // 选项ID "name": "optionName1" // 选项名 }, { "id": "id2", // 选项ID "name": "optionName2" // 选项名 } ]` |
|
|
12
|
+
| 日期 | date | `1688601600000 // 时间戳 "2023-12-20 03:00" // 或者 ISO 8601字符串` | `1688601600000 // 时间戳` |
|
|
13
|
+
| 人员 | user | `[ { unionId: "xxx" } ]` | `[ { "unionId": "xxx" }, {"unionId": "yyy" } ]` |
|
|
14
|
+
| 部门 | department | `[ { deptId: "xxx" } ]` | `[ { "deptId": "xxx" } ]` |
|
|
15
|
+
| 附件 | attachment | 具体请参考[上传附件](https://open.dingtalk.com/document/orgapp/notable-upload-attachment) 。 | `[ { "filename": "image.xlsx", "size": 92250, "type": "xls", "url": "xxx" } ]`<br> <br><br>**说明**<br><br>url是附件访问链接。<br><br>* 当附件是在线文档时,其是在线文档链接,该链接没有访问时效。<br> <br>* 当附件是其它文件时,是一个有**访问时效** 的下载链接,一段时间后该链接将无法访问。 |
|
|
16
|
+
| 单向关联 | unidirectionalLink | `{ "linkedRecordIds": [ "xxx", "yyy" ] }` | `{ "linkedRecordIds": [ "xxx", "yyy" ] }`<br> <br><br>**说明**<br><br>field property中包含关联的sheetId,配合这里返回的recordId,可以通过调用[获取记录](/document/orgapp/api-getrecord#) 接口去获取关联记录的值。 |
|
|
17
|
+
| 双向关联 | bidirectionalLink | `{ "linkedRecordIds": [ "xxx", "yyy" ] }` | `{ "linkedRecordIds": [ "xxx", "yyy" ] }` |
|
|
18
|
+
| 链接 | url | `{ "text": "Dingtalk", "link": "https://dingtalk.com" }` | `{ "text": "Dingtalk", "link": "https://dingtalk.com" }` |
|
package/dist/utils/localTools.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {DateUtils} from './DateUtils.js'
|
|
2
2
|
import {FileUtils} from './file.js'
|
|
3
3
|
|
|
4
|
-
const localTools = ["currentDateTime", "notableSupportedFieldInfo", "notableRecordValuesFormat"]
|
|
4
|
+
const localTools = ["currentDateTime", "notableSupportedSearchFilters", "notableSupportedFieldInfo", "notableRecordValuesFormat"]
|
|
5
5
|
|
|
6
6
|
export class LocalTools{
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ export class LocalTools{
|
|
|
12
12
|
static callTool(tool){
|
|
13
13
|
if (tool.name === "currentDateTime"){
|
|
14
14
|
return DateUtils.getFormattedLocalNow();
|
|
15
|
-
}else if (tool.name === "notableSupportedFieldInfo" || tool.name === "notableRecordValuesFormat"){
|
|
15
|
+
}else if (tool.name === "notableSupportedSearchFilters" || tool.name === "notableSupportedFieldInfo" || tool.name === "notableRecordValuesFormat"){
|
|
16
16
|
return FileUtils.readLocalFileContent(tool);
|
|
17
17
|
}
|
|
18
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dingtalk-mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"description": "DingTalk MCP Server - A TypeScript-based MCP server for DingTalk integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@modelcontextprotocol/sdk": "^0.4.0",
|
|
31
31
|
"axios": "^1.6.0",
|
|
32
|
+
"dingtalk-mcp": "file:dingtalk-mcp-1.1.12.tgz",
|
|
32
33
|
"dotenv": "^16.3.0",
|
|
33
34
|
"js-yaml": "^4.1.0"
|
|
34
35
|
},
|