Install
$ agentstack add skill-aws-samples-sample-lark-mcp-on-agentcore-lark-wiki ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
wiki (v2)
> 成员管理硬限制: > - 如果目标是"部门",先判断身份,再决定是否继续。 > - bot identity 对应 tenant_access_token。官方限制:这种身份下不能使用部门 ID (opendepartmentid) 添加知识空间成员。 > - 遇到"部门 + bot identity"时,禁止先调用 lark_wiki_member_add 试错;直接说明该路径不可行。 > - ⚠️ bot identity 相关操作不可通过 MCP server 执行(MCP server 始终使用 user identity)。
身份说明
知识空间和节点都是用户的个人资源。MCP server 始终使用 user identity(authentication is handled automatically by the MCP server)。
快速决策
- 用户要按特定主题 / 关键词 / 内容线索查找资料并收集到知识库节点或新建知识库节点下,必须先调用
lark_get_skill(domain="drive", section="workflow"),再按其中Workflow Registry进入topic_move_collectorworkflow(调用lark_get_skill(domain="drive", section="workflow-topic-move-collector"))。该 workflow 使用 Drive 全量搜索召回,再按 Wiki 目标解析、确认和移动;不要只用 Wiki 节点列表做局部遍历。 - 用户要整理 / 盘点 / 归类 / 重构知识库、个人文档库、文档库目录或 Wiki 节点结构,或要生成整理方案、目标目录树、移动计划时,不要只使用 Wiki 节点 API。必须先调用
lark_get_skill(domain="drive", section="workflow"),再按其中Workflow Registry进入knowledge_organizeworkflow(调用lark_get_skill(domain="drive", section="workflow-knowledge-organize"));该 workflow 负责 Drive / Wiki / 个人文档库的统一入口解析、资源盘点、分类计划、写前确认和结果验证。 - 用户要把已有 Wiki 节点移出知识库,放到 Drive 文件夹或"我的空间"根目录:使用
lark_wiki_move_to_drive,不要使用lark_wiki_move或lark_drive_move。这是会改变节点归属和权限继承的写操作,执行前确认源节点与目标位置。 - 用户给的是知识库 URL(
.../wiki/),且后续要查成员/加成员/删成员:先调用lark_invoke(tool_name="lark_wiki_spaces_get_node", args={params: {"token": ""}})获取space_id,后续成员接口统一使用space_id。 - 用户要删除知识空间(
lark_wiki_delete_space)但只给了名称或 URL:不能把名称 / URL 原样传给space_id,必须先解析出真实space_id。解析方式: - URL(
.../wiki/):lark_invoke(tool_name="lark_wiki_spaces_get_node", args={params: {"token": ""}, format: "json"}),读data.node.space_id。 - 只知名称:
lark_wiki_space_list(format="json"),边翻页边收集 items 并按name精确匹配;一旦任一页累计到至少 1 条精确匹配就停止翻页。只有当翻完所有页(has_more=false)仍无精确匹配时,才对已收集的全量 items 做宽松匹配(nametrim 空格、大小写不敏感、子串包含)。 - 关键安全约束:无论精确还是模糊,无论命中 1 条还是多条,发起删除前都必须把候选(
name+space_id+description+space_type)列给用户,由用户明确选定一个space_id再执行。不要因为"只命中一条"就自动执行删除。 - 命中 0 条:停下来问用户是名称拼错了还是调用方无权限;不要自行改名字重试。
- 用户明确选定后再执行
lark_wiki_delete_space(space_id="", _confirm=true)(高风险写操作)。 - 反例:不要把 wiki URL / 名称直接当
space_id(如space_id="https://.../wiki/");务必先用lark_invoke(tool_name="lark_wiki_spaces_get_node", ...)解析出data.node.space_id再传。 - 用户要在知识库中创建新节点,优先使用
lark_wiki_node_create。 - 用户要列出 Wiki 节点:先用
lark_wiki_space_list拿数字space_id,再用lark_wiki_node_list(space_id="")。不要把 wiki URL、node token、doc token、名称直接当space_id。钻子节点时parent_node_token必须是 wiki node token;如果用户给的是 docx/sheet/base URL,先用lark_wiki_node_get(node_token="")解析出node_token。 lark_wiki_node_list命中invalid_parameters、not_found、permission_denied时,不要重复调用同一参数;按 hint 修space_id/parent_node_token/ 权限。只有rate_limit才做退避重试。- 用户说"给知识库添加成员/管理员":先把目标解析成"用户 / 群 / 部门 / 应用"四类之一,再决定
member_type,不要先调lark_wiki_member_add再根据报错反推类型。 - 用户说"部门 + bot":这是已知不支持路径。⚠️ This operation requires bot identity and is not available via the MCP server.
- 用户说"用户 / 群 / 应用 + 添加成员":先解析对应 ID,再执行
lark_wiki_member_add。 - 用户说"查看 / 列出空间成员":用
lark_wiki_member_list;该 shortcut 默认只取一页,多成员场景显式加page_all=true。 - 用户说"移除 / 删除空间成员":用
lark_wiki_member_remove,必须传齐原始授予时的member_type和member_role(不知道就先lark_wiki_member_list查一下)。
Shortcuts(推荐优先使用)
Shortcut 是对常用操作的高级封装。有 Shortcut 的操作优先使用。
| Shortcut | 说明 | |----------|------| | lark_wiki_move | Move a wiki node, or move a Drive document into Wiki | | lark_wiki_move_to_drive | Move a wiki node to a Drive folder and poll the async task | | lark_wiki_node_create | Create a wiki node with automatic space resolution | | lark_wiki_delete_space | Delete a wiki space, polling the async delete task when needed | | lark_wiki_space_list | List all wiki spaces accessible to the caller | | lark_wiki_space_create | Create a wiki space (user identity only) | | lark_wiki_node_list | List wiki nodes in a space or under a parent node (supports pagination) | | lark_wiki_node_copy | Copy a wiki node to a target space or parent node | | lark_wiki_node_get | Get a wiki node's details by nodetoken / objtoken / Lark URL | | lark_wiki_node_delete | Delete a wiki node, polling the async delete task when needed | | lark_wiki_member_add | Add a member to a wiki space | | lark_wiki_member_remove | Remove a member from a wiki space | | lark_wiki_member_list | List members of a wiki space (supports pagination) |
成员添加流程
- 调用
lark_wiki_member_add前,先把自然语言里的"人 / 群 / 部门 / 应用"解析成正确的member_id,不要猜格式。 - 用户场景默认优先
member_type="openid":用lark_contact_search_user(query="")获取open_id。 - 群组场景使用
member_type="openchat":用lark_im_chat_search(query="")获取chat_id。 - 应用场景使用
member_type="appid":member_id传应用 ID,格式通常为cli_xxx。 userid/unionid只在下游明确要求时才使用;先拿到open_id,再调用lark_invoke(tool_name="lark_contact_users_get", args={params: {"user_id_type": "open_id"}})读取user_id/union_id。- 部门场景使用
member_type="opendepartmentid":调用lark_invoke(tool_name="lark_contact_departments_search", args={params: {"department_id_type": "open_department_id"}, data: {"query": ""}})获取open_department_id。 - 只有在目标类型确认可行后,才调用
lark_wiki_member_add。
目标语义约束
我的文档库/My Document Library/我的知识库/个人知识库/my_library都应视为 Wiki personal library,不是 Drive 根目录- 处理这类目标时,先解析
my_library对应的真实space_id,再执行lark_wiki_move、lark_wiki_node_create或其他 Wiki 写操作 - 不要因为缺少显式
space_id就退化成lark_drive_move - 如果用户明确说的是 Drive 文件夹、云空间(云盘/云存储)根目录、
我的空间,再按源对象分流:源对象是 Wiki 节点时用lark_wiki_move_to_drive,源对象已在 Drive 时用lark_drive_move
API Resources
lark_discover(query="wiki..") # 调用原生 API 前必须先查看 params / data 参数结构,不要猜测字段格式
lark_invoke(tool_name="lark_wiki__", args={...}) # 调用 API
spaces
create— 创建知识空间get— 获取知识空间信息get_node— 获取知识空间节点信息list— 获取知识空间列表
members
create— 添加知识空间成员delete— 删除知识空间成员list— 获取知识空间成员列表
nodes
copy— 创建知识空间节点副本create— 创建知识空间节点list— 获取知识空间子节点列表
不在本 skill 范围
- 上传 / 下载文件到知识库节点下 → lark-drive(
lark_drive_uploadwithwiki_tokenparam) - 编辑文档正文内容 → lark-doc
- 表格 / 多维表格数据操作 → lark-sheets / lark-base
- 按名称搜索文档 / Wiki / 表格文件、评论与权限管理 → lark-drive
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: aws-samples
- Source: aws-samples/sample-lark-mcp-on-agentcore
- License: MIT-0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.