← 返回 Skills 市场
aliramw

dingtalk-docs

作者 Marila Wang · GitHub ↗ · v0.3.4
cross-platform ✓ 安全检测通过
882
总下载
4
收藏
8
当前安装
7
版本数
在 OpenClaw 中安装
/install dingtalk-docs
功能描述
管理钉钉云文档中的文档、文件夹和内容。当用户想要创建文档、搜索文档、读取或写入文档内容、创建文件夹整理文档时使用。也适用于用户提到云文档、在线文档、钉钉文档、钉文档等关键词的场景。不要在用户需要操作多维表、管理日程、发消息或处理审批流时触发。
使用说明 (SKILL.md)

钉钉云文档 Skill

Overview

用户可能要求你创建、搜索、读取或编辑钉钉云文档。操作之间存在严格依赖关系:必须先获取 ID 才能执行后续操作。

严格禁止

  1. 禁止编造 ID -- dentryUuid 必须从返回值中提取,编造 ID 会操作到错误文档或报错
  2. 创建前必须先获取根目录 ID -- 必须先调 get_my_docs_root_dentry_uuid 拿到 rootDentryUuid
  3. 禁止混淆两个创建方法 -- create_doc_under_node 只能创建文档,create_dentry_under_node 支持文件夹/表格/PPT 等多种类型
  4. 写入前必须确认 updateType -- 0=覆盖(清空后写入),1=续写(追加到末尾),搞反会丢数据,不确定时必须先问用户
  5. 禁止只传 ID 读内容 -- 必须拼成完整 URL https://alidocs.dingtalk.com/i/nodes/{dentryUuid}
  6. 禁止在用户说"表格"时默认创建文档 -- 可能要在线表格(accessType="1")或多维表(accessType="7"),不确定必须先问
  7. 禁止传错参数类型 -- accessType 必须是字符串,updateType 必须是数字,类型传错会导致静默失败

可用方法列表

方法 用途 必填参数 可用性
get_my_docs_root_dentry_uuid 获取"我的文档"根目录 ID 稳定可用
list_accessible_documents 搜索有权限的文档 无 (keyword 选填) 稳定可用
create_doc_under_node 创建在线文档 name, parentDentryUuid 稳定可用
create_dentry_under_node 创建节点 (文档/表格/文件夹等) name, accessType, parentDentryUuid 稳定可用
write_content_to_document 写入文档内容 (覆盖或续写) content, updateType, targetDentryUuid 稳定可用
get_document_content_by_url 通过 URL 获取文档 Markdown 内容 docUrl 灰度中,部分实例不可见

灰度发布说明(重要)

根据 GitHub issue #1 下维护者的明确回复:get_document_content_by_url 目前在灰度中,全量还需要一点时间

因此你必须按下面规则处理:

  1. 如果 MCP 客户端里只看到 5 个工具,不要先判断为配置错误
  2. 如果缺少 get_document_content_by_url,不要先判断为权限缺失
  3. 通过钉钉 MCP 广场拿到的 URL,当前很可能因为服务端未放量而看不到该方法
  4. 在该方法未放开前,Skill 应把“读文档内容”视为条件可用能力,不是所有环境都保证存在
  5. 向用户说明时要直接说清:这是官方灰度状态,不是本地接入姿势问题

意图判断

用户说"创建文档/新建文档/写个文档/帮我建个文档":

  • 创建文档 → 先 get_my_docs_root_dentry_uuid,再 create_doc_under_node
  • 创建到指定文件夹 → 用文件夹的 dentryUuid 作为 parentDentryUuid

用户说"建文件夹/新建目录/整理一下文档":

  • 创建文件夹 → create_dentry_under_node(accessType="13")

用户说"创建表格/建个PPT/做个脑图":

  • 非文档类型 → create_dentry_under_node,accessType: 表格="1",PPT="2",脑图="6",多维表="7"
  • 用户说"表格"但不确定类型 → 先问是在线表格还是多维表

关键区分: 在线表格(accessType="1") vs 多维表(accessType="7") vs 文档(用 create_doc_under_node)

用户说"搜索/找文档/查一下/有没有某个文档":

  • 搜索 → list_accessible_documents(keyword=关键词)

用户说"读文档/看看内容/打开文档/这个文档写了什么":

  • 先确认当前 MCP 服务是否真的暴露了 get_document_content_by_url
  • 有 URL 且该方法可用 → 直接 get_document_content_by_url
  • 有文档名且该方法可用 → 先 list_accessible_documents 搜索,拿到 dentryUuid,拼 URL 再读
  • 如果当前实例缺少 get_document_content_by_url → 明确告诉用户:该读取能力目前仍在官方灰度中,你的实例暂未放开,不要把原因归咎于用户配置

用户说"写入/更新内容/编辑文档/往文档里加点东西":

  • 全新内容或替换 → write_content_to_document(updateType=0) 覆盖
  • 追加内容 → write_content_to_document(updateType=1) 续写
  • 不确定 → 问用户是覆盖还是追加

核心工作流

创建文档并写入:

  1. get_my_docs_root_dentry_uuid() → 提取 rootDentryUuid
  2. create_doc_under_node(name, parentDentryUuid=rootDentryUuid) → 提取 dentryUuid
  3. (HARD-GATE: 必须确认 updateType) write_content_to_document(content, updateType=0, targetDentryUuid=dentryUuid) → 提取写入结果
  4. get_document_content_by_url(docUrl="https://alidocs.dingtalk.com/i/nodes/{dentryUuid}") → 验证

搜索并读取(仅当 get_document_content_by_url 已放量可用时):

  1. list_accessible_documents(keyword="关键词") → 提取 docs[].dentryUuid
  2. get_document_content_by_url(docUrl="https://alidocs.dingtalk.com/i/nodes/{dentryUuid}")

如果当前实例没有 get_document_content_by_url

  • 停在搜索结果这一步
  • 明确提示用户该能力仍处于官方灰度阶段
  • 不要伪造“读取成功”或编造替代读接口

创建文件夹并整理:

  1. get_my_docs_root_dentry_uuid() → 提取 rootDentryUuid
  2. create_dentry_under_node(name, accessType="13", parentDentryUuid=rootDentryUuid) → 提取 dentryUuid
  3. create_doc_under_node(name, parentDentryUuid=文件夹dentryUuid)

上下文传递规则

操作 从返回中提取 用于
get_my_docs_root_dentry_uuid rootDentryUuid create_doc_under_node / create_dentry_under_node 的 parentDentryUuid
create_doc_under_node dentryUuid write_content_to_document 的 targetDentryUuid,拼 URL 读内容
create_dentry_under_node dentryUuid 作为子节点的 parentDentryUuid
list_accessible_documents docs[].dentryUuid 拼成 https://alidocs.dingtalk.com/i/nodes/{dentryUuid} 用于读取

CRITICAL: 参数格式

// [正确] docUrl 必须是完整 URL
{"docUrl": "https://alidocs.dingtalk.com/i/nodes/DnRL6jAJ..."}
// [错误] 只传 ID → 报错
{"docUrl": "DnRL6jAJ..."}

// [正确] accessType 是字符串
{"name": "报表", "accessType": "1", "parentDentryUuid": "xxx"}
// [错误] accessType 传数字 → 静默失败
{"name": "报表", "accessType": 1, "parentDentryUuid": "xxx"}

// [正确] updateType 是数字
{"content": "...", "updateType": 0, "targetDentryUuid": "xxx"}
// [错误] updateType 传字符串 → 静默失败
{"content": "...", "updateType": "0", "targetDentryUuid": "xxx"}

本地文件脚本说明

scripts/ 目录中的辅助脚本会处理本地文件输入 / 输出:

  • import_docs.py 会读取工作区内的 .md / .txt / .markdown 文件并导入到钉钉文档
  • export_docs.py 会将钉钉文档内容导出为工作区内的本地 Markdown 文件
  • create_doc.py 会调用 mcporter 创建文档并写入内容

这些脚本都受以下规则约束:

  • 仅允许访问工作区内路径
  • 使用 resolve_safe_path() 防止目录遍历
  • 限制文件大小和扩展名
  • 仅通过 mcporter 调用 MCP 服务,不直接发起网络请求

错误处理

  1. 遇到错误: 展示错误信息给用户,不要自行猜测解决方案
  2. "Invalid credentials": 提示用户重新配置凭证
  3. "Permission denied": 提示用户确认对该文档有操作权限
  4. "Document not found": 用 list_accessible_documents 重新搜索确认文档是否存在
  5. 如果方法列表里根本没有 get_document_content_by_url:按官方灰度未放量处理,不要误报为本地配置错误
  6. 错误码 52600007: 可能是企业账号限制或父节点 ID 无效,确认 parentDentryUuid 来源

详细参考 (按需读取)

安全使用建议
This skill appears internally consistent and implements expected safety checks (path sandboxing, size/extension limits). Before installing: 1) Ensure the mcporter binary you install comes from an official source; 2) Treat DINGTALK_MCP_DOCS_URL as a sensitive token — prefer storing it in mcporter config as recommended instead of exporting it to your shell history; 3) Be aware the provided import/export scripts will read and write files inside your workspace (they enforce a workspace sandbox but don’t access outside paths); 4) If you need stricter isolation, avoid running the local scripts or review them before use. If you want extra assurance, inspect/validate the mcporter config and the exact MCP service URL you provide.
功能分析
Type: OpenClaw Skill Name: dingtalk-docs Version: 0.3.4 The dingtalk-docs skill bundle is a well-structured tool for managing DingTalk cloud documents with significant emphasis on security and reliability. It implements robust safety features including a path sandbox in `mcporter_utils.py` to prevent directory traversal, file size and extension white-listing in `import_docs.py`, and content length limits across all scripts. The `SKILL.md` instructions are defensive, specifically designed to prevent accidental data loss (e.g., confirming overwrite vs. append) and to guide the agent through API gray-scale rollouts without hallucinating errors. No evidence of malicious intent, data exfiltration, or unauthorized command execution was found.
能力评估
Purpose & Capability
Name/description match what is required: mcporter is the expected client for MCP tools and DINGTALK_MCP_DOCS_URL is the service URL/token needed to call the documented MCP methods. Required binaries and env vars are proportionate to a MCP-based DingTalk docs integration.
Instruction Scope
SKILL.md and scripts limit actions to document create/search/read/write flows using mcporter. Scripts that read/write local files (import/export) explicitly constrain themselves to the workspace, enforce path-sandboxing, allowed extensions and size limits, and only call MCP via mcporter rather than making raw network calls.
Install Mechanism
No install spec (instruction-only) — nothing is downloaded or executed automatically. The package contains helper scripts for local use; they run mcporter via subprocess which is expected for this integration. No suspicious URLs or extraction steps are present.
Credentials
Only DINGTALK_MCP_DOCS_URL is declared as required (primaryEnv). Scripts optionally use OPENCLAW_WORKSPACE to constrain file access but do not require other secrets. The declared env var is justified since it contains the MCP streamable URL/token.
Persistence & Privilege
always is false and the skill does not request persistent/privileged system changes. It does not modify other skills or system-wide configs. Autonomous invocation is allowed (platform default) but not combined with broad unexplained access.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install dingtalk-docs
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /dingtalk-docs 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.3.4
Align registry metadata with package.json and README; declare mcporter and DINGTALK_MCP_DOCS_URL; document local file behavior of import/export scripts.
v0.3.3
Align gray-rollout guidance across README, SKILL, and reference docs; clarify that get_document_content_by_url may be absent because rollout is not complete.
v0.3.2
Clarify that get_document_content_by_url is still in gray rollout; document 5 stable tools plus 1 gray-release tool.
v0.3.1
open-spec 合规审计修复:严格禁止措辞、HARD-GATE 写入流程、意图区分强化
v0.2.1
修复测试套件与代码不一致;18/18 测试通过
v0.2.0
统一传参方式为 --args JSON
v0.1.1
添加 scripts 和 tests - 完善文档操作脚本和安全测试
元数据
Slug dingtalk-docs
版本 0.3.4
许可证
累计安装 9
当前安装数 8
历史版本数 7
常见问题

dingtalk-docs 是什么?

管理钉钉云文档中的文档、文件夹和内容。当用户想要创建文档、搜索文档、读取或写入文档内容、创建文件夹整理文档时使用。也适用于用户提到云文档、在线文档、钉钉文档、钉文档等关键词的场景。不要在用户需要操作多维表、管理日程、发消息或处理审批流时触发。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 882 次。

如何安装 dingtalk-docs?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install dingtalk-docs」即可一键安装,无需额外配置。

dingtalk-docs 是免费的吗?

是的,dingtalk-docs 完全免费(开源免费),可自由下载、安装和使用。

dingtalk-docs 支持哪些平台?

dingtalk-docs 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 dingtalk-docs?

由 Marila Wang(@aliramw)开发并维护,当前版本 v0.3.4。

💬 留言讨论