@wecom/wecom-openclaw-plugin 2026.5.25-beta.1 → 2026.5.25-beta.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wecom-doc
|
|
3
|
-
description:
|
|
3
|
+
description: 企业微信文档管理技能。支持企业微信文档、表格(在线表格)、智能表格和智能文档(原名智能主页)的管理。具体能力:(1) 以 Markdown 格式获取文档/表格/智能表格的完整内容 (2) 新建文档或智能表格 (3) 用 Markdown 覆写文档内容 (4) 创建智能文档,将本地 Markdown 文件发布为智能文档 (5) 导出智能文档内容为 Markdown 文件。用户提及 `https://doc.weixin.qq.com/xxxx` 格式的URL链接时,需要使用此技能。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# 企业微信文档管理
|
|
@@ -15,19 +15,22 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
15
15
|
|
|
16
16
|
## URL 品类识别与接口路由
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
企业微信文档有四种品类,**URL 格式不同,读取内容所用的接口也不同**,切勿混用。其中**表格(在线表格)与智能表格是两类不同品类**,请通过 URL 严格区分:
|
|
19
19
|
|
|
20
20
|
| URL 模式 | 品类 | 读取内容接口 |
|
|
21
21
|
|---|---|---|
|
|
22
22
|
| `https://doc.weixin.qq.com/doc/*` | **文档**(doc_type=3) | `get_doc_content` |
|
|
23
|
-
| `https://doc.weixin.qq.com/
|
|
23
|
+
| `https://doc.weixin.qq.com/sheet/*` | **表格 / 在线表格** | `get_doc_content` |
|
|
24
|
+
| `https://doc.weixin.qq.com/smartsheet/*` | **智能表格**(doc_type=10) | `smartsheet_get_sheet` → `smartsheet_get_records` |
|
|
24
25
|
| `https://doc.weixin.qq.com/smartpage/*` | **智能文档**(原名智能主页) | `smartpage_export_task` → `smartpage_get_export_result` |
|
|
25
26
|
|
|
26
27
|
**判断规则**:
|
|
27
28
|
- URL 路径以 `/doc/*` 开头 → 文档 → 用 `get_doc_content`
|
|
28
|
-
- URL 路径以 `/
|
|
29
|
+
- URL 路径以 `/sheet/*` 开头 → 表格(在线表格) → 用 `get_doc_content`
|
|
30
|
+
- URL 路径以 `/smartsheet/*` 开头 → 智能表格 → 用 `smartsheet_get_sheet`
|
|
29
31
|
- URL 路径以 `/smartpage/*` 开头 → 智能文档(原名智能主页) → 用 `smartpage_export_task`
|
|
30
32
|
|
|
33
|
+
> ⚠️ **表格 ≠ 智能表格**:二者是不同品类(`/sheet/` vs `/smartsheet/`)。
|
|
31
34
|
|
|
32
35
|
## 调用方式
|
|
33
36
|
|
|
@@ -57,21 +60,24 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
57
60
|
|
|
58
61
|
## 文档
|
|
59
62
|
|
|
60
|
-
适用品类:文档(doc_type=3
|
|
61
|
-
适用 URL:`/doc/*`、`/smartsheet/*`
|
|
63
|
+
适用品类:文档(doc_type=3)、表格(在线表格)和智能表格(doc_type=10)
|
|
64
|
+
适用 URL:`/doc/*`、`/sheet/*`、`/smartsheet/*`
|
|
62
65
|
|
|
63
66
|
适用场景:
|
|
64
|
-
1. 以 Markdown
|
|
67
|
+
1. 以 Markdown 格式导出获取文档 / 表格 / 智能表格完整内容(异步轮询)
|
|
65
68
|
2. 新建文档(doc_type=3)或智能表格(doc_type=10)
|
|
66
69
|
3. 用 Markdown 格式覆写文档内容
|
|
67
70
|
|
|
68
71
|
### get_doc_content
|
|
69
72
|
|
|
70
|
-
|
|
73
|
+
获取**文档 / 表格(在线表格) / 智能表格**的完整内容数据,统一以 Markdown 格式返回。采用**异步轮询机制**:首次调用无需传 `task_id`,接口返回 `task_id`;若 `task_done` 为 false,需携带该 `task_id` 再次调用,直到 `task_done` 为 true 时返回完整内容。
|
|
74
|
+
|
|
75
|
+
> 适用 URL:`/doc/*`、`/sheet/*`、`/smartsheet/*`。`/smartpage/*`(智能文档)不适用,请改用 `smartpage_export_task`。
|
|
71
76
|
|
|
72
77
|
- 首次调用(不传 task_id):使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"docid": "DOCID", "type": 2}'`
|
|
73
78
|
- 轮询(携带上次返回的 task_id):使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"docid": "DOCID", "type": 2, "task_id": "xxx"}'`
|
|
74
|
-
-
|
|
79
|
+
- 通过 URL 读取文档:使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"url": "https://doc.weixin.qq.com/doc/xxx", "type": 2}'`
|
|
80
|
+
- 通过 URL 读取表格(在线表格):使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"url": "https://doc.weixin.qq.com/sheet/xxx", "type": 2}'`
|
|
75
81
|
|
|
76
82
|
参见 [API 详情](references/get-doc-content.md)。
|
|
77
83
|
|
|
@@ -85,6 +91,7 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
85
91
|
**注意**:
|
|
86
92
|
- docid 仅在创建时返回,需妥善保存。创建智能表格时默认包含一个子表
|
|
87
93
|
- 智能表格(doc_type=10)的详细管理功能(子表、字段、数据记录等)已迁移到 `wecom-smartsheet` skill,请使用该 skill 进行高级操作
|
|
94
|
+
- 普通表格(在线表格,URL 含 `/sheet/`)本 skill **仅支持读取**(通过 `get_doc_content`),不支持创建
|
|
88
95
|
|
|
89
96
|
参见 [API 详情](references/create-doc.md)。
|
|
90
97
|
|
|
@@ -145,11 +152,11 @@ description: 企业微信文档管理技能。支持企业微信文档、智能
|
|
|
145
152
|
|
|
146
153
|
## 典型工作流
|
|
147
154
|
|
|
148
|
-
> **关键提示**:读取内容前先看 URL 判断品类。`/doc/` 或 `/smartsheet/` → `get_doc_content`;`/smartpage/` → `smartpage_export_task`。只有用户明确提到「智能文档」或「智能主页」时才走 smartpage 流程,其他文档场景一律使用企微文档接口。
|
|
155
|
+
> **关键提示**:读取内容前先看 URL 判断品类。`/doc/`、`/sheet/` 或 `/smartsheet/` → `get_doc_content`;`/smartpage/` → `smartpage_export_task`。只有用户明确提到「智能文档」或「智能主页」时才走 smartpage 流程,其他文档场景一律使用企微文档接口。
|
|
149
156
|
|
|
150
|
-
###
|
|
157
|
+
### 文档 / 表格 / 智能表格读取与文档编辑
|
|
151
158
|
|
|
152
|
-
1.
|
|
159
|
+
1. **读取文档 / 表格 / 智能表格**(URL 含 `/doc/`、`/sheet/` 或 `/smartsheet/`) → 使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"docid": "DOCID", "type": 2}'`,或通过 URL(`/doc/*`、`/sheet/*`、`/smartsheet/*` 均适用):使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"url": "https://doc.weixin.qq.com/sheet/xxx", "type": 2}'`,若 `task_done` 为 false 则携带 `task_id` 继续轮询
|
|
153
160
|
2. **创建新文档** → 使用 `wecom_mcp` tool 调用 `wecom_mcp call doc create_doc '{"doc_type": 3, "doc_name": "文档名"}'`,保存返回的 docid
|
|
154
161
|
3. **编辑文档** → 先 get_doc_content 了解当前内容,再 edit_doc_content 覆写
|
|
155
162
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# get_doc_content API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
获取企业微信文档、表格的完整内容数据,以 Markdown 格式返回。该接口采用异步轮询机制:首次调用无需传 task_id,接口会返回 task_id;若 task_done 为 false,需携带该 task_id 再次调用,直到 task_done 为 true 时返回完整内容。
|
|
4
4
|
|
|
5
5
|
## 技能定义
|
|
6
6
|
|
|
@@ -72,7 +72,7 @@ description: 企业微信智能表格管理技能。提供智能表格的结构
|
|
|
72
72
|
|
|
73
73
|
在添加字段前,请先参阅所有字段类型和定义 [字段类型参考](references/smartsheet-field-types.md)。
|
|
74
74
|
|
|
75
|
-
>
|
|
75
|
+
> 注意:如果是首次创建表并调用这个方法添加字段的情况下,调用本接口前,你必须确认已完成以下操作,否则会多出一个无用的默认列:
|
|
76
76
|
> 1. 已调用 smartsheet_get_fields 查看子表现有字段(新子表会自带一个默认文本字段)
|
|
77
77
|
> 2. 已调用 smartsheet_update_fields 将该默认字段重命名为你需要的第一个字段名 然后在本接口中只传入剩余的字段(不包含第一个字段)。
|
|
78
78
|
|
|
@@ -1,38 +1,79 @@
|
|
|
1
1
|
# smartsheet_get_records API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
查询智能表格中指定子表的记录信息,支持分页读取。支持通过 docid 或文档 URL 定位文档,二者传入其一即可。
|
|
4
4
|
|
|
5
5
|
## 技能定义
|
|
6
6
|
|
|
7
7
|
```json
|
|
8
8
|
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
"name": "smartsheet_get_records",
|
|
10
|
+
"description": "查询智能表格中指定子表的记录信息。支持分页查询(cursor + limit),不填 cursor 从第一行开始。支持通过 docid 或文档 URL 定位文档,二者传入其一即可。",
|
|
11
|
+
"inputSchema": {
|
|
12
|
+
"properties": {
|
|
13
|
+
"cursor": {
|
|
14
|
+
"anyOf": [
|
|
15
|
+
{
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "null"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"default": null,
|
|
23
|
+
"description": "查询游标,不填代表从第一行记录开始查询",
|
|
24
|
+
"title": "Cursor"
|
|
25
|
+
},
|
|
26
|
+
"docid": {
|
|
27
|
+
"anyOf": [
|
|
28
|
+
{
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "null"
|
|
33
|
+
}
|
|
32
34
|
],
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
35
|
+
"default": null,
|
|
36
|
+
"description": "文档的 docid,与 url 二选一传入",
|
|
37
|
+
"title": "Docid"
|
|
38
|
+
},
|
|
39
|
+
"limit": {
|
|
40
|
+
"anyOf": [
|
|
41
|
+
{
|
|
42
|
+
"type": "integer"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "null"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"default": null,
|
|
49
|
+
"description": "分页大小,每页返回多少条数据;当不填写该参数或将该参数设置为 0 时,如果总数大于 1000,一次性返回 1000 行记录,当总数小于 1000 时,返回全部记录;limit 最大值为 1000",
|
|
50
|
+
"title": "Limit"
|
|
51
|
+
},
|
|
52
|
+
"sheet_id": {
|
|
53
|
+
"description": "子表的 sheet_id,用于指定要查询的智能表格中的哪个子表",
|
|
54
|
+
"title": "Sheet Id",
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"url": {
|
|
58
|
+
"anyOf": [
|
|
59
|
+
{
|
|
60
|
+
"type": "string"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"type": "null"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"default": null,
|
|
67
|
+
"description": "文档的访问链接,与 docid 二选一传入",
|
|
68
|
+
"title": "Url"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"required": [
|
|
72
|
+
"sheet_id"
|
|
73
|
+
],
|
|
74
|
+
"title": "smartsheet_get_recordsArguments",
|
|
75
|
+
"type": "object"
|
|
76
|
+
}
|
|
36
77
|
}
|
|
37
78
|
```
|
|
38
79
|
|
|
@@ -40,12 +81,16 @@
|
|
|
40
81
|
|
|
41
82
|
| 参数 | 类型 | 必填 | 说明 |
|
|
42
83
|
|---|---|---|---|
|
|
84
|
+
| cursor | string | 否 | 查询游标,不填代表从第一行记录开始查询 |
|
|
43
85
|
| docid | string | 与 url 二选一 | 文档的 docid |
|
|
44
|
-
|
|
|
86
|
+
| limit | integer | 否 | 分页大小,每页返回多少条数据;当不填写该参数或将该参数设置为 0 时,如果总数大于 1000,一次性返回 1000 行记录,当总数小于 1000 时,返回全部记录;limit 最大值为 1000 |
|
|
45
87
|
| sheet_id | string | 是 | 子表的 sheet_id,用于指定要查询的智能表格中的哪个子表 |
|
|
88
|
+
| url | string | 与 docid 二选一 | 文档的访问链接 |
|
|
46
89
|
|
|
47
90
|
## 请求示例
|
|
48
91
|
|
|
92
|
+
以传入docid为例:
|
|
93
|
+
|
|
49
94
|
```json
|
|
50
95
|
{
|
|
51
96
|
"docid": "DOCID",
|
|
@@ -53,6 +98,8 @@
|
|
|
53
98
|
}
|
|
54
99
|
```
|
|
55
100
|
|
|
101
|
+
以传url为例:
|
|
102
|
+
|
|
56
103
|
```json
|
|
57
104
|
{
|
|
58
105
|
"url": "https://doc.weixin.qq.com/smartsheet/xxx",
|
|
@@ -60,37 +107,81 @@
|
|
|
60
107
|
}
|
|
61
108
|
```
|
|
62
109
|
|
|
63
|
-
##
|
|
110
|
+
## 响应示例(含分页)
|
|
64
111
|
|
|
65
112
|
```json
|
|
66
113
|
{
|
|
67
114
|
"errcode": 0,
|
|
68
115
|
"errmsg": "ok",
|
|
69
|
-
"total":
|
|
70
|
-
"has_more":
|
|
71
|
-
"
|
|
116
|
+
"total": 100,
|
|
117
|
+
"has_more": true,
|
|
118
|
+
"next_cursor": "mock_cursor_token",
|
|
72
119
|
"records": [
|
|
73
120
|
{
|
|
74
|
-
"record_id": "
|
|
75
|
-
"create_time": "
|
|
76
|
-
"update_time": "
|
|
121
|
+
"record_id": "rec_001",
|
|
122
|
+
"create_time": "1700000000000",
|
|
123
|
+
"update_time": "1700000000000",
|
|
77
124
|
"values": {
|
|
78
|
-
"
|
|
125
|
+
"成员": [
|
|
126
|
+
{"user_id": "real.user001", "id_type": 1}
|
|
127
|
+
],
|
|
128
|
+
"序号": [
|
|
129
|
+
{"text": "1", "type": "text"}
|
|
130
|
+
],
|
|
131
|
+
"附件": [
|
|
79
132
|
{
|
|
80
|
-
"
|
|
81
|
-
"
|
|
133
|
+
"doc_type": 2,
|
|
134
|
+
"file_ext": "xlsx",
|
|
135
|
+
"file_type": "Wedrive",
|
|
136
|
+
"file_url": "https://drive.weixin.qq.com/s?k=MOCK_TOKEN",
|
|
137
|
+
"name": "report.xlsx",
|
|
138
|
+
"size": 12345
|
|
82
139
|
}
|
|
83
|
-
]
|
|
84
|
-
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"creator_name": "张三",
|
|
143
|
+
"updater_name": "张三"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"record_id": "rec_002",
|
|
147
|
+
"create_time": "1700000000000",
|
|
148
|
+
"update_time": "1700000000000",
|
|
149
|
+
"values": {
|
|
150
|
+
"截图": [
|
|
85
151
|
{
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
152
|
+
"height": 1080,
|
|
153
|
+
"id": "img_mock_id",
|
|
154
|
+
"image_url": "https://wdcdn.qpic.cn/mocked_path?w=1920&h=1080",
|
|
155
|
+
"title": "screenshot_001",
|
|
156
|
+
"width": 1920
|
|
89
157
|
}
|
|
158
|
+
],
|
|
159
|
+
"序号": [
|
|
160
|
+
{"text": "2", "type": "text"}
|
|
90
161
|
]
|
|
91
|
-
}
|
|
162
|
+
},
|
|
163
|
+
"creator_name": "张三",
|
|
164
|
+
"updater_name": "李四"
|
|
92
165
|
}
|
|
93
166
|
]
|
|
94
167
|
}
|
|
95
168
|
```
|
|
96
169
|
|
|
170
|
+
## 响应数据结构
|
|
171
|
+
|
|
172
|
+
- `total`: 总记录数(integer)
|
|
173
|
+
- `has_more`: 是否还有更多数据(boolean)
|
|
174
|
+
- `next_cursor`: 下一页游标,用于分页(string,仅当 has_more 为 true 时存在)
|
|
175
|
+
- `records`: 记录数组
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
## 分页查询
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# 第一页
|
|
182
|
+
wecom_mcp call doc smartsheet_get_records '{"docid": "DOCID", "sheet_id": "SHEETID"}'
|
|
183
|
+
|
|
184
|
+
# 下一页(使用上一条的 next_cursor)
|
|
185
|
+
wecom_mcp call doc smartsheet_get_records '{"docid": "DOCID", "sheet_id": "SHEETID", "cursor": "上一条的 next_cursor 值"}'
|
|
186
|
+
```
|
|
187
|
+
|