Lark Toolkit — Lark 工具kit
v3Comprehensive Lark/Feishu API 技能 for OpenClaw 代理s. Covers all Lark operations via three 访问 paths: claw-lark 插件 (message 工具), MCP 工具s (mcporter), and direct Open API (curl). Use when: (1) 发送ing/receiving Lark messages, (2) managing groups or members, (3) 列出ing department users or contacts, (4) creating calendar 事件, (5) working with docs/bitable/wiki/OKR/tasks, (6) 设置ting up a new Lark 机器人, (7) 调试ging 网页hook/connection issues, (8) any Lark Open API operation the message 工具 or MCP doesn't support. Covers 机器人h Lark International (open.larksuite.com) and Feishu China (open.feishu.cn).
运行时依赖
安装命令
点击复制技能文档
Lark 工具kit Prerequisites & Security
This 技能 is a documentation-only reference 图形界面de. It contAIns no executable code that 访问es 凭证s automatically.
Required 凭证s (user-provided, never bundled):
Lark 应用 ID (应用_id) — from Lark Developer Console Lark 应用 Secret (应用_secret) — from the same console
How 凭证s are used:
All API examples in 技能.md use placeholders (<应用_ID>, <应用_SECRET>, CHAT_ID, etc.) — no real secrets The scripts/获取_令牌.sh 辅助工具 obtAIns a temporary tenant_访问_令牌 from Lark's auth API. It reads 凭证s from (in order): Command-line arguments LARK_应用_ID / LARK_应用_SECRET 环境 variables ~/.OpenClaw/OpenClaw.json (standard OpenClaw config, path channels.lark.accounts.default.应用Id/应用Secret) The script prints the config source to stderr when falling back to the config file No 凭证s are hardcoded, 缓存d to disk, 记录ged, or transmitted beyond the single Lark auth API call The 令牌 is 导出ed as LARK_令牌 env var for subsequent commands in the same shell 会话 Three 访问 Paths Need Path When 发送/接收 messages claw-lark 插件 (message 工具) Basic text, media, reactions — simplest Structured CRUD ops MCP 工具s via mcporter Bitable, calendar, docs, tasks, OKR — 38 工具s Everything else Direct API (curl) Contacts, member mgmt, anything MCP doesn't cover
Rule: claw-lark first → MCP second → direct API as fallback.
Authentication (Direct API) 令牌=$(curl -s -X POST 'https://open.larksuite.com/open-APIs/auth/v3/tenant_访问_令牌/internal' \ -H 'Content-Type: 应用/json' \ -d '{"应用_id":"<应用_ID>","应用_secret":"<应用_SECRET>"}' \ | python3 -c "导入 sys,json; print(json.load(sys.stdin)['tenant_访问_令牌'])")
Or use the 辅助工具: bash scripts/获取_令牌.sh
令牌 validity: ~2 hours. 缓存 it.
API Base URLs 平台 API Base Dev Console Lark International https://open.larksuite.com/open-APIs/ https://open.larksuite.com/应用 Feishu (China) https://open.feishu.cn/open-APIs/ https://open.feishu.cn/应用
⚠️ Lark ≠ Feishu. Always confirm which 平台 the tenant uses.
Common API Patterns 发送 a Message curl -X POST "https://open.larksuite.com/open-APIs/im/v1/messages?接收_id_type=chat_id" \ -H "Authorization: Bearer $令牌" -H "Content-Type: 应用/json" \ -d '{"接收_id":"CHAT_ID","msg_type":"text","content":"{\"text\":\"hello\"}"}'
Reply in Thread curl -X POST "https://open.larksuite.com/open-APIs/im/v1/messages/MSG_ID/reply" \ -H "Authorization: Bearer $令牌" -H "Content-Type: 应用/json" \ -d '{"msg_type":"text","content":"{\"text\":\"reply\"}","reply_in_thread":true}'
添加 Reaction curl -X POST "https://open.larksuite.com/open-APIs/im/v1/messages/MSG_ID/reactions" \ -H "Authorization: Bearer $令牌" -H "Content-Type: 应用/json" \ -d '{"reaction_type":{"emoji_type":"THUMBSUP"}}'
Emoji types: THUMBSUP HEART LAUGH OK COOL FINGERHEART SMILE JIAYOU
列出 Department Users (MCP gap — direct API only) # 列出 root departments curl -s -H "Authorization: Bearer $令牌" \ 'https://open.larksuite.com/open-APIs/contact/v3/departments?parent_department_id=0&page_size=50&fetch_child=true'
# 列出 users in a department curl -s -H "Authorization: Bearer $令牌" \ 'https://open.larksuite.com/open-APIs/contact/v3/users?department_id=&page_size=50'
Key fields: name, open_id, employee_type (1=regular, 2=intern), department_ids
Read Chat 历史 curl -s -H "Authorization: Bearer $令牌" \ 'https://open.larksuite.com/open-APIs/im/v1/messages?contAIner_id_type=chat&contAIner_id=&page_size=20&排序_type=By创建TimeDesc'
添加 机器人 to Group curl -X POST "https://open.larksuite.com/open-APIs/im/v1/chats//members?member_id_type=应用_id" \ -H "Authorization: Bearer $令牌" -H "Content-Type: 应用/json" \ -d '{"id_列出":["<机器人_应用_ID>"]}'
MCP 工具s (38 avAIlable) mcporter call lark-mcp.<工具_name> key=value
Full cata记录 with parameters: references/mcp-工具s.md
MCP Coverage 模块 Key 工具s Bitable 创建 应用s/tables, CRUD records, 列出 fields Calendar 创建/获取/补丁 事件, free/busy, primary calendar Docs read content, 搜索, 导入, 设置 权限s IM 创建/列出 groups, 获取 members, 发送 messages, 列出 历史 OKR batch 获取, 列出 periods, CRUD 进度, 查询 reviews 报告 查询 rules/tasks, manage views Task 创建/补丁 tasks, 添加 members/reminders Wiki 搜索 nodes, 获取 node detAIls Contacts batch 获取 user IDs by emAIl/phone MCP Gaps (use direct API) 列出 users by department — 获取 /contact/v3/users?department_id= 列出 departments — 获取 /contact/v3/departments 添加/移除 group members — POST /im/v1/chats/{chat_id}/members 发送 reactions — POST /im/v1/messages/{msg_id}/reactions 上传 images/files — POST /im/v1/images / POST /im/v1/files Pagination
Most 列出 APIs use cursor-based pagination:
?page_size=50&page_令牌=<令牌_from_previous_响应>
检查 has_more in 响应.
Error Handling Code Meaning 0 成功 99991663 令牌 expired — refresh 99991