@wecom/wecom-openclaw-plugin 1.0.12-beta.1 → 1.0.12-beta.3
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/dist/index.cjs.js +5 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/skills/wecom-contact-lookup/SKILL.md +3 -1
- package/skills/wecom-doc-manager/SKILL.md +14 -3
- package/skills/wecom-edit-todo/SKILL.md +2 -0
- package/skills/wecom-get-todo-detail/SKILL.md +2 -0
- package/skills/wecom-get-todo-list/SKILL.md +2 -0
- package/skills/wecom-meeting-create/SKILL.md +10 -4
- package/skills/wecom-meeting-create/references/example-full.md +1 -1
- package/skills/wecom-meeting-create/references/example-reminder.md +2 -2
- package/skills/wecom-meeting-create/references/example-security.md +1 -1
- package/skills/wecom-meeting-manage/SKILL.md +10 -25
- package/skills/wecom-meeting-query/SKILL.md +6 -4
- package/skills/wecom-preflight/SKILL.md +141 -0
- package/skills/wecom-schedule/SKILL.md +2 -0
- package/skills/wecom-smartsheet-data/SKILL.md +14 -3
- package/skills/wecom-smartsheet-schema/SKILL.md +14 -1
package/package.json
CHANGED
|
@@ -7,6 +7,8 @@ description: 通讯录成员查询技能,基于 MCP tool 协议封装的 `get_
|
|
|
7
7
|
|
|
8
8
|
> `wecom_mcp` 是一个 MCP tool,所有操作通过调用该 tool 完成。
|
|
9
9
|
|
|
10
|
+
> ⚠️ **前置条件**:首次调用 `wecom_mcp` 前,必须按 `wecom-preflight` 技能执行前置条件检查,确保工具已加入白名单。
|
|
11
|
+
|
|
10
12
|
通过 MCP tool 协议封装的 `get_userlist` 接口,获取当前用户可见范围内的通讯录成员,并在本地按姓名/别名进行筛选匹配。
|
|
11
13
|
|
|
12
14
|
## 操作
|
|
@@ -76,7 +78,7 @@ description: 通讯录成员查询技能,基于 MCP tool 协议封装的 `get_
|
|
|
76
78
|
- `get_userlist` 返回的是当前用户**可见范围内**的成员,需经过可见性规则过滤,不一定是全公司所有人员;返回字段仅包含 `userid`、`name`(姓名)和 `alias`(别名)
|
|
77
79
|
- ⚠️ **超过 10 人时接口将报错**:若 `userlist` 返回成员数量超过 10 人,视为异常,应立即停止处理并向用户说明:
|
|
78
80
|
|
|
79
|
-
>
|
|
81
|
+
> 当前通讯录可见成员数量超过了本技能支持的上限(10 人)。
|
|
80
82
|
> 本技能仅适用于可见范围较小的场景,无法在大范围通讯录中使用。
|
|
81
83
|
> 建议缩小可见范围后重试,或通过其他方式查询目标人员。
|
|
82
84
|
|
|
@@ -7,19 +7,30 @@ description: 企业微信文档管理技能。提供文档的创建、读取和
|
|
|
7
7
|
|
|
8
8
|
> `wecom_mcp` 是一个 MCP tool,所有操作通过调用该 tool 完成。
|
|
9
9
|
|
|
10
|
+
> ⚠️ **前置条件**:首次调用 `wecom_mcp` 前,必须按 `wecom-preflight` 技能执行前置条件检查,确保工具已加入白名单。
|
|
11
|
+
|
|
10
12
|
管理企业微信文档的创建、读取和编辑。所有接口支持通过 `docid` 或 `url` 二选一定位文档。
|
|
11
13
|
|
|
12
|
-
##
|
|
14
|
+
## 调用方式
|
|
13
15
|
|
|
14
16
|
通过 `wecom_mcp` tool 调用,品类为 `doc`:
|
|
15
17
|
|
|
16
18
|
使用 `wecom_mcp` tool 调用 `wecom_mcp call doc <tool_name> '<json_params>'` 调用指定技能
|
|
17
19
|
|
|
18
|
-
##
|
|
20
|
+
## 返回格式说明
|
|
21
|
+
|
|
22
|
+
所有接口返回 JSON 对象,包含以下公共字段:
|
|
23
|
+
|
|
24
|
+
| 字段 | 类型 | 说明 |
|
|
25
|
+
|------|------|------|
|
|
26
|
+
| `errcode` | integer | 返回码,`0` 表示成功,非 `0` 表示失败 |
|
|
27
|
+
| `errmsg` | string | 错误信息,成功时为 `"ok"` |
|
|
28
|
+
|
|
29
|
+
当 `errcode` 不为 `0` 时,说明接口调用失败,可重试 1 次;若仍失败,将 `errcode` 和 `errmsg` 展示给用户。
|
|
19
30
|
|
|
20
31
|
### get_doc_content
|
|
21
32
|
|
|
22
|
-
|
|
33
|
+
获取文档完整内容数据,只能以 Markdown 格式返回。采用**异步轮询机制**:首次调用无需传 `task_id`,接口返回 `task_id`;若 `task_done` 为 false,需携带该 `task_id` 再次调用,直到 `task_done` 为 true 时返回完整内容。
|
|
23
34
|
|
|
24
35
|
- 首次调用(不传 task_id):使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"docid": "DOCID", "type": 2}'`
|
|
25
36
|
- 轮询(携带上次返回的 task_id):使用 `wecom_mcp` tool 调用 `wecom_mcp call doc get_doc_content '{"docid": "DOCID", "type": 2, "task_id": "xxx"}'`
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wecom-meeting-create
|
|
3
|
-
description: 企业微信会议创建技能,
|
|
3
|
+
description: 企业微信会议创建技能, 支持创建预约会议. 当用户需要"创建会议", "预约会议", "约会议", "安排会议"时触发.
|
|
4
4
|
---
|
|
5
5
|
# 企业微信会议创建技能
|
|
6
6
|
|
|
7
7
|
> `wecom_mcp` 是一个 MCP tool,所有操作通过调用该 tool 完成。
|
|
8
8
|
|
|
9
|
+
> ⚠️ **前置条件**:首次调用 `wecom_mcp` 前,必须按 `wecom-preflight` 技能执行前置条件检查,确保工具已加入白名单。
|
|
10
|
+
|
|
9
11
|
## 概述
|
|
10
12
|
|
|
11
|
-
wecom-meeting-create 提供企业微信预约会议的创建能力, 支持设置会议参数,
|
|
13
|
+
wecom-meeting-create 提供企业微信预约会议的创建能力, 支持设置会议参数, 邀请参与人等.
|
|
12
14
|
|
|
13
15
|
## 命令调用方式
|
|
14
16
|
|
|
@@ -22,11 +24,11 @@ wecom-meeting-create 提供企业微信预约会议的创建能力, 支持设置
|
|
|
22
24
|
|
|
23
25
|
### 创建预约会议 (create_meeting)
|
|
24
26
|
|
|
25
|
-
创建一个预约会议,
|
|
27
|
+
创建一个预约会议, 支持设置会议参数配置等.
|
|
26
28
|
|
|
27
29
|
#### 执行命令
|
|
28
30
|
|
|
29
|
-
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting create_meeting '{"title": "
|
|
31
|
+
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting create_meeting '{"title": "<会议标题>", "meeting_start_datetime": "<会议开始时间>", "meeting_duration": <会议持续时长(秒)>}'`
|
|
30
32
|
|
|
31
33
|
#### 入参说明
|
|
32
34
|
|
|
@@ -40,6 +42,8 @@ wecom-meeting-create 提供企业微信预约会议的创建能力, 支持设置
|
|
|
40
42
|
| `invitees` | object | 是 | 被邀请人, 格式:`{"userid": ["lisi", "wangwu"]}` |
|
|
41
43
|
| `settings` | object | 否 | 会议设置 (详见下方) |
|
|
42
44
|
|
|
45
|
+
> 被邀请人 userid 通过 `wecom-contact-lookup` 技能获取
|
|
46
|
+
|
|
43
47
|
**settings 字段:**
|
|
44
48
|
|
|
45
49
|
| 参数 | 类型 | 说明 |
|
|
@@ -53,6 +57,8 @@ wecom-meeting-create 提供企业微信预约会议的创建能力, 支持设置
|
|
|
53
57
|
| `remind_scope` | integer | 提醒范围 (1: 不提醒, 2: 仅提醒主持人, 3: 提醒所有成员, 4: 指定部分人响铃, 默认仅提醒主持人) |
|
|
54
58
|
| `ring_users` | object | 响铃用户, 格式:`{"userid": ["lisi"]}` |
|
|
55
59
|
|
|
60
|
+
> 响铃用户 userid 通过 `wecom-contact-lookup` 技能获取
|
|
61
|
+
|
|
56
62
|
#### 返回参数
|
|
57
63
|
|
|
58
64
|
```json
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 创建会议 - 响铃提醒场景示例
|
|
2
2
|
|
|
3
|
-
## 场景
|
|
3
|
+
## 场景 2: 仅提醒主持人 + 提前提醒时间
|
|
4
4
|
|
|
5
5
|
**用户意图**: "帮我创建一个会议, 只提醒主持人, 并在会议开始前15分钟和1小时各提醒一次"
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
## 场景
|
|
26
|
+
## 场景 3: 指定部分人响铃 (remind_scope=4)
|
|
27
27
|
|
|
28
28
|
**用户意图**: "帮我创建一个会议, 只响铃提醒张三和李四, 其他人不提醒"
|
|
29
29
|
|
|
@@ -6,6 +6,8 @@ description: 企业微信会议管理技能, 支持取消会议和更新会议
|
|
|
6
6
|
|
|
7
7
|
> `wecom_mcp` 是一个 MCP tool,所有操作通过调用该 tool 完成。
|
|
8
8
|
|
|
9
|
+
> ⚠️ **前置条件**:首次调用 `wecom_mcp` 前,必须按 `wecom-preflight` 技能执行前置条件检查,确保工具已加入白名单。
|
|
10
|
+
|
|
9
11
|
## 概述
|
|
10
12
|
|
|
11
13
|
wecom-meeting-manage 提供企业微信会议管理能力, 包含以下功能:
|
|
@@ -29,14 +31,13 @@ wecom-meeting-manage 提供企业微信会议管理能力, 包含以下功能:
|
|
|
29
31
|
|
|
30
32
|
#### 调用命令
|
|
31
33
|
|
|
32
|
-
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting cancel_meeting '{"meetingid": "
|
|
34
|
+
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting cancel_meeting '{"meetingid": "<会议id>"}'`
|
|
33
35
|
|
|
34
36
|
#### 入参说明
|
|
35
37
|
|
|
36
38
|
| 参数 | 类型 | 必填 | 说明 |
|
|
37
39
|
| ----------------- | ------ | ---- | ---------------------------------- |
|
|
38
40
|
| `meetingid` | string | 是 | 会议 ID, 通过 `wecom-meeting-query` 技能获取 |
|
|
39
|
-
| `sub_meetingid` | string | 否 | 子会议 ID (取消周期性会议的某一场) |
|
|
40
41
|
|
|
41
42
|
#### 返回参数
|
|
42
43
|
|
|
@@ -55,7 +56,7 @@ wecom-meeting-manage 提供企业微信会议管理能力, 包含以下功能:
|
|
|
55
56
|
|
|
56
57
|
#### 调用命令
|
|
57
58
|
|
|
58
|
-
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting set_invite_meeting_members '{"meetingid": "
|
|
59
|
+
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting set_invite_meeting_members '{"meetingid": "<会议id>", "invitees": [{"userid": "lisi"}, {"userid": "wangwu"}]}'`
|
|
59
60
|
|
|
60
61
|
#### 入参说明
|
|
61
62
|
|
|
@@ -65,6 +66,7 @@ wecom-meeting-manage 提供企业微信会议管理能力, 包含以下功能:
|
|
|
65
66
|
| `invitees` | array | 否 | 受邀成员列表, 每项包含 `userid` 字段 |
|
|
66
67
|
|
|
67
68
|
> **注意**: invitees 为全量覆盖, 传入的列表将替换现有成员列表.
|
|
69
|
+
> invitees 的 userid 通过 `wecom-contact-lookup` 技能获取
|
|
68
70
|
|
|
69
71
|
#### 返回参数
|
|
70
72
|
|
|
@@ -86,17 +88,9 @@ wecom-meeting-manage 提供企业微信会议管理能力, 包含以下功能:
|
|
|
86
88
|
**步骤:**
|
|
87
89
|
|
|
88
90
|
1. **定位会议**: 通过 `wecom-meeting-query` 技能查询会议列表 + 关键词匹配找到目标会议.
|
|
89
|
-
2.
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
确认要取消以下会议吗?
|
|
93
|
-
📅 技术方案评审
|
|
94
|
-
🕐 2026-03-18 15:00 - 16:00
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
3. **用户确认后, 执行取消**:
|
|
91
|
+
2. **直接执行取消**:
|
|
98
92
|
|
|
99
|
-
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting cancel_meeting '{"meetingid": "target_meetingid"}'`
|
|
93
|
+
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting cancel_meeting '{"meetingid": "<target_meetingid>"}'`
|
|
100
94
|
|
|
101
95
|
4. **展示结果**:
|
|
102
96
|
|
|
@@ -113,7 +107,7 @@ wecom-meeting-manage 提供企业微信会议管理能力, 包含以下功能:
|
|
|
113
107
|
**步骤:**
|
|
114
108
|
|
|
115
109
|
1. **定位会议**: 通过 `wecom-meeting-query` 技能查询会议列表 + 匹配找到目标会议.
|
|
116
|
-
2. **获取当前受邀成员**: `set_invite_members` 为全量覆盖,
|
|
110
|
+
2. **获取当前受邀成员**: `set_invite_members` 为全量覆盖, 必须先通过 `wecom-meeting-query` 技能的 `get_meeting_info` 获取会议详情, 获取现有成员后再合并.
|
|
117
111
|
3. **通讯录查询**: 调用 `wecom-contact-lookup` 技能获取通讯录成员, 按姓名筛选出王五的 userid.
|
|
118
112
|
|
|
119
113
|
使用 `wecom_mcp` tool 调用 `wecom_mcp call contact get_userlist '{}'`
|
|
@@ -121,17 +115,9 @@ wecom-meeting-manage 提供企业微信会议管理能力, 包含以下功能:
|
|
|
121
115
|
在返回的 `userlist` 中筛选 `name` 包含 "王五" 的成员, 获取其 `userid`.
|
|
122
116
|
|
|
123
117
|
4. **合并成员列表**: 将现有成员 + 新增成员合并 (全量覆盖).
|
|
124
|
-
5.
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
确认更新会议成员吗?
|
|
128
|
-
📅 技术方案评审
|
|
129
|
-
👥 更新后成员: 张三, 李四, 王五 (新增)
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
6. **用户确认后, 执行更新**:
|
|
118
|
+
5. **执行更新**:
|
|
133
119
|
|
|
134
|
-
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting set_invite_meeting_members '{"meetingid": "target_meetingid", "invitees": [{"userid": "zhangsan"}, {"userid": "lisi"}, {"userid": "wangwu"}]}'`
|
|
120
|
+
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting set_invite_meeting_members '{"meetingid": "<target_meetingid>", "invitees": [{"userid": "zhangsan"}, {"userid": "lisi"}, {"userid": "wangwu"}]}'`
|
|
135
121
|
|
|
136
122
|
7. **展示结果**:
|
|
137
123
|
|
|
@@ -146,6 +132,5 @@ wecom-meeting-manage 提供企业微信会议管理能力, 包含以下功能:
|
|
|
146
132
|
|
|
147
133
|
- **参与人仅支持企业内成员**, 不支持外部人员
|
|
148
134
|
- **通讯录查询**: 涉及参与人时, 需先通过 `wecom-contact-lookup` 技能的 `get_userlist` 接口获取全量通讯录成员, 再按姓名/别名本地筛选匹配出对应的 `userid`. 该接口无入参, 返回当前用户可见范围内的成员列表 (含 `userid`, `name`, `alias`)
|
|
149
|
-
- **操作前确认**: 取消会议和更新成员前, 先向用户展示操作预览, 确认后再执行
|
|
150
135
|
- **定位会议**: 管理操作需先通过 `wecom-meeting-query` 技能查询到目标会议的 meetingid
|
|
151
136
|
- **成员更新为全量覆盖**: `set_invite_members` 传入的列表将替换现有成员列表, 需先获取当前成员再合并
|
|
@@ -6,6 +6,8 @@ description: 企业微信会议查询技能, 支持查询会议列表, 获取会
|
|
|
6
6
|
|
|
7
7
|
> `wecom_mcp` 是一个 MCP tool,所有操作通过调用该 tool 完成。
|
|
8
8
|
|
|
9
|
+
> ⚠️ **前置条件**:首次调用 `wecom_mcp` 前,必须按 `wecom-preflight` 技能执行前置条件检查,确保工具已加入白名单。
|
|
10
|
+
|
|
9
11
|
## 概述
|
|
10
12
|
|
|
11
13
|
wecom-meeting-query 提供企业微信会议查询能力, 包含以下功能:
|
|
@@ -65,7 +67,7 @@ wecom-meeting-query 提供企业微信会议查询能力, 包含以下功能:
|
|
|
65
67
|
|
|
66
68
|
#### 执行命令
|
|
67
69
|
|
|
68
|
-
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting get_meeting_info '{"meetingid": "
|
|
70
|
+
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting get_meeting_info '{"meetingid": "<会议id>"}'`
|
|
69
71
|
|
|
70
72
|
#### 入参说明
|
|
71
73
|
|
|
@@ -239,8 +241,8 @@ wecom-meeting-query 提供企业微信会议查询能力, 包含以下功能:
|
|
|
239
241
|
|
|
240
242
|
3. **逐个查询会议详情** (对返回的每个 meetingid):
|
|
241
243
|
|
|
242
|
-
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting get_meeting_info '{"meetingid": "
|
|
243
|
-
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting get_meeting_info '{"meetingid": "
|
|
244
|
+
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting get_meeting_info '{"meetingid": "<会议id1>"}'`
|
|
245
|
+
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting get_meeting_info '{"meetingid": "<会议id2>"}'`
|
|
244
246
|
|
|
245
247
|
4. **汇总展示**:
|
|
246
248
|
|
|
@@ -273,7 +275,7 @@ wecom-meeting-query 提供企业微信会议查询能力, 包含以下功能:
|
|
|
273
275
|
1. **定位会议**: 先通过会议列表查询找到目标会议的 meetingid (按关键词匹配).
|
|
274
276
|
2. **查询详情**:
|
|
275
277
|
|
|
276
|
-
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting get_meeting_info '{"meetingid": "target_meetingid"}'`
|
|
278
|
+
使用 `wecom_mcp` tool 调用 `wecom_mcp call meeting get_meeting_info '{"meetingid": "<target_meetingid>"}'`
|
|
277
279
|
|
|
278
280
|
3. **展示结果**:
|
|
279
281
|
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wecom-preflight
|
|
3
|
+
description: 企业微信插件前置条件检查。在执行任何 wecom_mcp 操作前,通过 shell 命令检查工具权限配置(profile 和白名单),若缺失则自动修复并提示用户重启 Gateway。所有使用 wecom_mcp 的技能都应在首次调用前执行此检查。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 企业微信前置条件检查
|
|
7
|
+
|
|
8
|
+
> 本技能确保 `wecom_mcp` 工具已正确获得执行权限。**所有使用 wecom_mcp 的技能在首次调用前,必须先执行本检查流程。**
|
|
9
|
+
|
|
10
|
+
## 触发条件
|
|
11
|
+
|
|
12
|
+
当满足以下**任一条件**时,执行前置检查:
|
|
13
|
+
|
|
14
|
+
1. 当前会话中**首次**需要调用 `wecom_mcp` 工具
|
|
15
|
+
2. 调用 `wecom_mcp` 时收到 `tool not allowed`、`not permitted`、`permission denied` 或类似权限错误
|
|
16
|
+
|
|
17
|
+
> 如果当前会话中已成功调用过 `wecom_mcp`(任何操作),则无需重复检查。
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 检查流程
|
|
22
|
+
|
|
23
|
+
> **重要**:以下所有步骤均为 **shell 命令**(在终端中执行),**不是** MCP tool 调用。
|
|
24
|
+
> `wecom_mcp` 在未加入白名单前对 AI Agent 不可见,因此不能用 tool 调用来探测。
|
|
25
|
+
|
|
26
|
+
### 步骤 1:检查 tools.profile
|
|
27
|
+
|
|
28
|
+
在终端执行以下命令,读取当前 `tools.profile` 配置:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
openclaw config get tools.profile
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
根据返回结果分流:
|
|
35
|
+
|
|
36
|
+
- **返回 `full`** → ✅ **检查通过**。`full` 模式无任何工具限制,所有工具(包括 `wecom_mcp`)直接可用,无需检查 `alsoAllow`,继续执行用户原始请求
|
|
37
|
+
- **返回其他值**(如 `coding`、`messaging`、`minimal`、`undefined` 或空)→ 进入步骤 1b(检查 alsoAllow)
|
|
38
|
+
- **命令执行失败**(如 `command not found: openclaw`、权限错误等)→ 进入步骤 3(环境异常)
|
|
39
|
+
|
|
40
|
+
### 步骤 1b:检查 tools.alsoAllow
|
|
41
|
+
|
|
42
|
+
在终端执行以下命令,读取当前 `tools.alsoAllow` 配置:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
openclaw config get tools.alsoAllow
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
根据返回结果分流:
|
|
49
|
+
|
|
50
|
+
- **返回内容包含 `wecom_mcp`**(如 `["wecom_mcp"]` 或 `["wecom_mcp", "other_tool"]`)→ ✅ 白名单已配置,检查通过,继续执行用户原始请求
|
|
51
|
+
- **返回内容不包含 `wecom_mcp`**(如空数组 `[]`、`undefined`、或列表中没有 `wecom_mcp`)→ 进入步骤 2(自动修复)
|
|
52
|
+
- **命令执行失败** → 进入步骤 3(环境异常)
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### 步骤 2:自动修复 tools.alsoAllow
|
|
57
|
+
|
|
58
|
+
在终端执行以下命令,将 `wecom_mcp` 加入工具白名单:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
openclaw config set tools.alsoAllow '["wecom_mcp"]'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
> **注意**:如果步骤 1b 返回的列表中已有其他工具(如 `["other_tool"]`),需要合并后再写入,例如:
|
|
65
|
+
> ```bash
|
|
66
|
+
> openclaw config set tools.alsoAllow '["other_tool", "wecom_mcp"]'
|
|
67
|
+
> ```
|
|
68
|
+
|
|
69
|
+
根据执行结果分流:
|
|
70
|
+
|
|
71
|
+
#### 2a. 命令执行成功
|
|
72
|
+
|
|
73
|
+
向用户回复(**不要自动执行重启**):
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
✅ 已自动将 wecom_mcp 加入工具执行权限白名单(tools.alsoAllow)。
|
|
77
|
+
⚠️ 配置变更需要重启 Gateway 后才能生效,请在终端执行以下命令:
|
|
78
|
+
|
|
79
|
+
openclaw gateway restart
|
|
80
|
+
|
|
81
|
+
重启完成后请重新发送您的请求。
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> **为什么不自动重启**:`openclaw gateway restart` 会中断当前所有活跃连接(包括本会话),
|
|
85
|
+
> 如果由 AI 自动执行,用户可能无法看到完整的提示信息。交由用户手动重启更可控。
|
|
86
|
+
|
|
87
|
+
#### 2b. 命令执行失败
|
|
88
|
+
|
|
89
|
+
向用户回复以下手动修复指引:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
❌ 自动配置失败,请在终端手动执行以下命令:
|
|
93
|
+
|
|
94
|
+
openclaw config set tools.alsoAllow '["wecom_mcp"]'
|
|
95
|
+
openclaw gateway restart
|
|
96
|
+
|
|
97
|
+
完成后请重新发送您的请求。
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### 步骤 3:环境异常处理
|
|
103
|
+
|
|
104
|
+
如果步骤 1 或 1b 的 `openclaw` 命令本身执行失败(如 `command not found`、权限不足等),说明 OpenClaw CLI 未正确安装或不在 PATH 中,直接告知用户:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
⚠️ OpenClaw CLI 不可用:<错误信息>
|
|
108
|
+
|
|
109
|
+
可能原因:
|
|
110
|
+
- OpenClaw 未安装或未加入系统 PATH
|
|
111
|
+
- OpenClaw 版本过低,不支持 config 子命令
|
|
112
|
+
- 当前 shell 环境缺少必要配置
|
|
113
|
+
|
|
114
|
+
请检查 OpenClaw 安装状态后重试。
|
|
115
|
+
参考:https://docs.openclaw.dev/installation
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 注意事项
|
|
121
|
+
|
|
122
|
+
1. **全程使用 shell 命令**:本技能的所有探测和修复操作均通过 `openclaw` CLI 在终端中执行,**不涉及任何 MCP tool 调用**。这样可以避免"tool 未白名单 → tool 不可见 → 无法探测"的死锁问题
|
|
123
|
+
2. **profile 优先判断**:`tools.profile` 为 `full` 时所有工具无限制,无需检查 `alsoAllow`,可快速跳过
|
|
124
|
+
3. **幂等性**:如果 `tools.alsoAllow` 中已包含 `wecom_mcp`,`openclaw config set` 命令不会产生副作用
|
|
125
|
+
4. **保留已有配置**:修改 `tools.alsoAllow` 时,需保留列表中已有的其他工具名,仅追加 `wecom_mcp`
|
|
126
|
+
5. **不自动重启**:自动配置成功后仅提示用户重启并附上命令,由用户手动执行,避免会话中断导致信息丢失
|
|
127
|
+
6. **会话缓存**:在同一个会话中,一旦检查通过(profile 为 full 或 alsoAllow 包含 wecom_mcp),后续调用无需重复检查
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 快速参考
|
|
132
|
+
|
|
133
|
+
| 场景 | 处理方式 |
|
|
134
|
+
|------|---------|
|
|
135
|
+
| 首次调用 wecom_mcp 前 | 执行 `openclaw config get tools.profile` 检查 |
|
|
136
|
+
| `tools.profile` 为 `full` | ✅ 跳过,直接执行原始请求 |
|
|
137
|
+
| profile 非 full + alsoAllow 已包含 wecom_mcp | ✅ 跳过,继续执行 |
|
|
138
|
+
| profile 非 full + alsoAllow 不包含 → 自动写入成功 | 提示已配置 + 附 `openclaw gateway restart` 命令让用户重启 |
|
|
139
|
+
| profile 非 full + alsoAllow 不包含 → 自动写入失败 | 给出手动修复指引 |
|
|
140
|
+
| openclaw CLI 不可用 | 告知用户检查 OpenClaw 安装 |
|
|
141
|
+
| 会话中已成功调用过 wecom_mcp | 跳过检查 |
|
|
@@ -7,6 +7,8 @@ description: 企业微信智能表格数据(记录)管理技能。提供智
|
|
|
7
7
|
|
|
8
8
|
> `wecom_mcp` 是一个 MCP tool,所有操作通过调用该 tool 完成。
|
|
9
9
|
|
|
10
|
+
> ⚠️ **前置条件**:首次调用 `wecom_mcp` 前,必须按 `wecom-preflight` 技能执行前置条件检查,确保工具已加入白名单。
|
|
11
|
+
|
|
10
12
|
管理智能表格中的记录(行数据)。所有接口支持通过 `docid` 或 `url` 二选一定位文档。
|
|
11
13
|
|
|
12
14
|
## CLI 调用方式
|
|
@@ -15,7 +17,16 @@ description: 企业微信智能表格数据(记录)管理技能。提供智
|
|
|
15
17
|
|
|
16
18
|
使用 `wecom_mcp` tool 调用 `wecom_mcp call doc <tool_name> '<json_params>'` 调用指定技能
|
|
17
19
|
|
|
18
|
-
##
|
|
20
|
+
## 返回格式说明
|
|
21
|
+
|
|
22
|
+
所有接口返回 JSON 对象,包含以下公共字段:
|
|
23
|
+
|
|
24
|
+
| 字段 | 类型 | 说明 |
|
|
25
|
+
|------|------|------|
|
|
26
|
+
| `errcode` | integer | 返回码,`0` 表示成功,非 `0` 表示失败 |
|
|
27
|
+
| `errmsg` | string | 错误信息,成功时为 `"ok"` |
|
|
28
|
+
|
|
29
|
+
当 `errcode` 不为 `0` 时,说明接口调用失败,可重试 1 次;若仍失败,将 `errcode` 和 `errmsg` 展示给用户。
|
|
19
30
|
|
|
20
31
|
### smartsheet_get_records
|
|
21
32
|
|
|
@@ -38,7 +49,7 @@ description: 企业微信智能表格数据(记录)管理技能。提供智
|
|
|
38
49
|
|
|
39
50
|
### smartsheet_update_records
|
|
40
51
|
|
|
41
|
-
|
|
52
|
+
更新一行或多行记录,单次必须在 500 行内。需提供 record_id(通过 `smartsheet_get_records` 获取)。
|
|
42
53
|
|
|
43
54
|
使用 `wecom_mcp` tool 调用 `wecom_mcp call doc smartsheet_update_records '{"docid": "DOCID", "sheet_id": "SHEETID", "records": [{"record_id": "RECORDID", "values": {"任务名称": [{"type": "text", "text": "更新后的内容"}]}}]}'`
|
|
44
55
|
|
|
@@ -46,7 +57,7 @@ description: 企业微信智能表格数据(记录)管理技能。提供智
|
|
|
46
57
|
|
|
47
58
|
### smartsheet_delete_records
|
|
48
59
|
|
|
49
|
-
|
|
60
|
+
删除一行或多行记录,单次必须在 500 行内。**操作不可逆**。record_id 通过 `smartsheet_get_records` 获取。
|
|
50
61
|
|
|
51
62
|
使用 `wecom_mcp` tool 调用 `wecom_mcp call doc smartsheet_delete_records '{"docid": "DOCID", "sheet_id": "SHEETID", "record_ids": ["RECORDID1", "RECORDID2"]}'`
|
|
52
63
|
|
|
@@ -7,14 +7,27 @@ description: 企业微信智能表格结构管理技能。提供子表(Sheet
|
|
|
7
7
|
|
|
8
8
|
> `wecom_mcp` 是一个 MCP tool,所有操作通过调用该 tool 完成。
|
|
9
9
|
|
|
10
|
+
> ⚠️ **前置条件**:首次调用 `wecom_mcp` 前,必须按 `wecom-preflight` 技能执行前置条件检查,确保工具已加入白名单。
|
|
11
|
+
|
|
10
12
|
管理智能表格的子表和字段(列)结构。所有接口支持通过 `docid` 或 `url` 二选一定位文档。
|
|
11
13
|
|
|
12
|
-
##
|
|
14
|
+
## 调用方式
|
|
13
15
|
|
|
14
16
|
通过 `wecom_mcp` tool 调用,品类为 `doc`:
|
|
15
17
|
|
|
16
18
|
使用 `wecom_mcp` tool 调用 `wecom_mcp call doc <tool_name> '<json_params>'` 调用指定技能
|
|
17
19
|
|
|
20
|
+
## 返回格式说明
|
|
21
|
+
|
|
22
|
+
所有接口返回 JSON 对象,包含以下公共字段:
|
|
23
|
+
|
|
24
|
+
| 字段 | 类型 | 说明 |
|
|
25
|
+
|------|------|------|
|
|
26
|
+
| `errcode` | integer | 返回码,`0` 表示成功,非 `0` 表示失败 |
|
|
27
|
+
| `errmsg` | string | 错误信息,成功时为 `"ok"` |
|
|
28
|
+
|
|
29
|
+
当 `errcode` 不为 `0` 时,说明接口调用失败,可重试 1 次;若仍失败,将 `errcode` 和 `errmsg` 展示给用户。
|
|
30
|
+
|
|
18
31
|
## 子表管理
|
|
19
32
|
|
|
20
33
|
### smartsheet_get_sheet
|