SuperAPI AI Directory

wecom-preflight

Deployment & operations

View repository

Updated 10-16 08:49

About this skill

WeCom prerequisite check

This skill ensures that the wecom_mcp tool has correctly obtained execution permission.All skills that use wecom_mcp must perform this check flow before their first call.

Trigger conditions

When the followingany conditionis met, perform the prerequisite check:

  1. In the current session,the first timeyou need to call the wecom_mcp tool
  2. When calling wecom_mcp , you receive tool not allowed、not permitted、permission denied or a similar permission error

If wecom_mcphas already been called successfully in the current session (any operation), there is no need to repeat the check.


Check flow

Important: All the following steps are shell commands(executed in the terminal),not MCP tool calls. wecom_mcp is not visible to the AI Agent before it is added to the allowlist, so it cannot be probed with a tool call.

Step 1: Check tools.profile

Run the following command in the terminal to read the current tools.profile configuration:

openclaw config get tools.profile

Branch based on the returned result:

  • Returns full → ✅ Check passed。full . full mode has no tool restrictions; all tools (including wecom_mcp) are directly available, no need to check alsoAllow, continue executing the user's original request
  • Returns another value(such as coding、messaging、minimal、undefined or empty) → go to step 1b (check alsoAllow)
  • Command execution failed(such as command not found: openclaw, permission error, etc.) → go to step 3 (environment exception)

Step 1b: Check tools.alsoAllow

Run the following command in the terminal to read the current tools.alsoAllow configuration:

openclaw config get tools.alsoAllow

Branch based on the returned result:

  • The returned content contains wecom_mcp(such as ["wecom_mcp"] or ["wecom_mcp", "other_tool"]) → ✅ The allowlist is configured, check passed, continue executing the user's original request
  • The returned content does not contain wecom_mcp(such as the empty array []、undefined, or the list does not contain wecom_mcp) → go to step 2 (automatic fix)
  • Command execution failed → go to step 3 (environment exception)

Step 2: Automatically fix tools.alsoAllow

Run the following command in the terminal to add wecom_mcp to the tool allowlist:

openclaw config set tools.alsoAllow '["wecom_mcp"]'

Note: If the list returned by step 1b already contains other tools (such as ["other_tool"]), they need to be merged before writing, for example:

openclaw config set tools.alsoAllow '["other_tool", "wecom_mcp"]'

Branch based on the execution result:

2a. Command executed successfully

Reply to the user (do not automatically execute a restart):

✅ 已自动将 wecom_mcp 加入工具执行权限白名单(tools.alsoAllow)。
⚠️ 配置变更需要重启 Gateway 后才能生效,请在终端执行以下命令:

openclaw gateway restart

重启完成后请重新发送您的请求。

Why not restart automatically:openclaw gateway restart will interrupt all currently active connections (including this session), if executed automatically by the AI, the user may not be able to see the complete prompt information. It is more controllable to let the user restart manually.

2b. Command execution failed

Reply to the user with the following manual repair instructions:

❌ 自动配置失败,请在终端手动执行以下命令:

openclaw config set tools.alsoAllow '["wecom_mcp"]'
openclaw gateway restart

完成后请重新发送您的请求。

Step 3: Environment exception handling

If the openclaw command itself fails to execute (such as command not found, insufficient permissions, etc.), it means the OpenClaw CLI is not correctly installed or not in PATH; directly inform the user:

⚠️ OpenClaw CLI 不可用:<错误信息>

可能原因:
- OpenClaw 未安装或未加入系统 PATH
- OpenClaw 版本过低,不支持 config 子命令
- 当前 shell 环境缺少必要配置

请检查 OpenClaw 安装状态后重试。
参考:https://docs.openclaw.dev/installation

Precautions

  1. Use shell commands throughout: All probing and repair operations of this skill are executed in the terminal via the openclaw CLI,without involving any MCP tool calls. This avoids the deadlock problem of "tool not allowlisted → tool invisible → unable to probe"
  2. profile priority check:tools.profile is full , all tools are unrestricted, no need to check alsoAllow, can be quickly skipped
  3. Idempotency: If tools.alsoAllow already contains wecom_mcp,openclaw config set the command will not produce side effects
  4. Preserve existing configuration: When modifying tools.alsoAllow , you need to preserve the other existing tool names in the list and only append wecom_mcp
  5. Do not automatically restart: After successful automatic configuration, only prompt the user to restart and provide the command, to be executed manually by the user, avoiding information loss caused by session interruption
  6. Session cache: In the same session, once the check passes (profile is full or alsoAllow contains wecom_mcp), subsequent calls do not need to repeat the check

Quick reference

Scenario Handling method
Before the first call to wecom_mcp Execute openclaw config get tools.profile check
tools.profile is full ✅ Skip, directly execute the original request
profile is not full + alsoAllow already contains wecom_mcp ✅ Skip, continue execution
profile is not full + alsoAllow does not contain it → automatic write succeeds Prompt that it has been configured + attach the openclaw gateway restart command for the user to restart
profile is not full + alsoAllow does not contain it → automatic write fails Provide manual repair instructions
openclaw CLI unavailable Inform the user to check the OpenClaw installation
wecom_mcp has been successfully called in the session Skip the check