lark-docs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Lark Docs Access (飞书云文档权限)

Lark文档访问(飞书云文档权限)

以用户身份访问和搜索飞书云文档,包括文档、表格、多维表格和知识库等。
Access and search Lark cloud documents as the authenticated user, including docs, sheets, bitables, and wiki spaces.
以用户身份访问和搜索飞书云文档,包括文档、表格、多维表格和知识库等。
以已认证用户身份访问并搜索Lark云文档,包括文档、表格、多维表格和知识库空间。

Quick Start

快速开始

Search for Documents (搜索文档)

搜索文档

搜索包含'OKR'的文档
Search for documents containing 'product roadmap'
搜索包含'OKR'的文档
Search for documents containing 'product roadmap'

Access Document Content (访问文档内容)

访问文档内容

获取这个文档的内容:https://example.feishu.cn/docx/abc123
Get the content of this document: https://example.feishu.cn/wiki/xyz789
获取这个文档的内容:https://example.feishu.cn/docx/abc123
Get the content of this document: https://example.feishu.cn/wiki/xyz789

Search Wiki Spaces (搜索知识库)

搜索知识库

在知识库中搜索关于'架构设计'的内容
Search wiki for 'system architecture' documentation
在知识库中搜索关于'架构设计'的内容
Search wiki for 'system architecture' documentation

Key Features

核心功能

1. Document Search (文档搜索)

1. 文档搜索

Search across all document types that the user has access to:
  • Documents (文档): docx format documents
  • Sheets (表格): spreadsheet documents
  • Bitables (多维表格): database/table documents
  • Wiki (知识库): wiki pages and spaces
Available MCP Tools:
  • mcp__lark__docx_builtin_search
    - Search cloud documents
  • mcp__lark__wiki_v1_node_search
    - Search wiki content
Search Parameters:
  • search_key
    (required): Keyword to search for
  • docs_types
    : Filter by document type (doc, sheet, bitable, mindnote, file)
  • owner_ids
    : Filter by document owner's open_id
  • chat_ids
    : Filter by group where document is located
  • count
    : Number of results (max 50, default 10)
  • offset
    : Pagination offset
可搜索用户有权限访问的所有文档类型:
  • 文档:docx格式文档
  • 表格:电子表格文档
  • 多维表格:数据库/表格类文档
  • 知识库:知识库页面和空间
可用MCP工具:
  • mcp__lark__docx_builtin_search
    - 搜索云文档
  • mcp__lark__wiki_v1_node_search
    - 搜索知识库内容
搜索参数:
  • search_key
    (必填):要搜索的关键词
  • docs_types
    :按文档类型筛选(doc、sheet、bitable、mindnote、file)
  • owner_ids
    :按文档所有者的open_id筛选
  • chat_ids
    :按文档所在群组筛选
  • count
    :结果数量(最大50,默认10)
  • offset
    :分页偏移量

2. Document Content Access (文档内容访问)

2. 文档内容访问

Retrieve the actual content of documents:
Available MCP Tools:
  • mcp__lark__docx_v1_document_rawContent
    - Get plain text content
  • mcp__lark__wiki_v2_space_getNode
    - Get wiki node information
Parameters:
  • document_id
    : The unique document identifier
  • lang
    : Language for @mentions (0=Chinese, 1=English)
获取文档的实际内容:
可用MCP工具:
  • mcp__lark__docx_v1_document_rawContent
    - 获取纯文本内容
  • mcp__lark__wiki_v2_space_getNode
    - 获取知识库节点信息
参数:
  • document_id
    :唯一的文档标识符
  • lang
    :@提及对象的显示语言(0=中文,1=英文)

3. Permission Management (权限管理)

3. 权限管理

Check and manage document permissions:
Available MCP Tools:
  • mcp__lark__drive_v1_permissionMember_create
    - Add permissions
Permission Roles:
  • view
    : Read-only access
  • edit
    : Can edit the document
  • full_access
    : Full management access
检查并管理文档权限:
可用MCP工具:
  • mcp__lark__drive_v1_permissionMember_create
    - 添加权限
权限角色:
  • view
    :只读访问
  • edit
    :可编辑文档
  • full_access
    :完全管理权限

Common Workflows

常见工作流

Workflow 1: Search and Read Documents

工作流1:搜索并读取文档

markdown
1. User: "搜索包含'产品路线图'的文档"
2. Assistant uses: mcp__lark__docx_builtin_search
   - search_key: "产品路线图"
   - count: 10
3. Display results with titles and URLs
4. User: "打开第一个文档"
5. Assistant uses: mcp__lark__docx_v1_document_rawContent
   - document_id: extracted from URL
6. Display document content
markdown
1. 用户: "搜索包含'产品路线图'的文档"
2. 助手使用: mcp__lark__docx_builtin_search
   - search_key: "产品路线图"
   - count: 10
3. 显示带标题和链接的结果
4. 用户: "打开第一个文档"
5. 助手使用: mcp__lark__docx_v1_document_rawContent
   - document_id: 从URL中提取
6. 显示文档内容

Workflow 2: Wiki Navigation

工作流2:知识库导航

markdown
1. User: "Show me the engineering wiki"
2. Assistant uses: mcp__lark__wiki_v1_node_search
   - query: "engineering"
3. Display wiki pages and their hierarchy
4. User: "Get the content of the API documentation page"
5. Assistant uses: mcp__lark__wiki_v2_space_getNode
   - token: wiki_page_token
6. Display wiki content
markdown
1. User: "Show me the engineering wiki"
2. Assistant uses: mcp__lark__wiki_v1_node_search
   - query: "engineering"
3. Display wiki pages and their hierarchy
4. User: "Get the content of the API documentation page"
5. Assistant uses: mcp__lark__wiki_v2_space_getNode
   - token: wiki_page_token
6. Display wiki content

Workflow 3: Document Discovery by Owner

工作流3:按所有者查找文档

markdown
1. User: "张三创建的所有文档"
2. First get user ID: mcp__lark__contact_v3_user_batchGetId
   - emails: ["zhangsan@company.com"]
3. Then search: mcp__lark__docx_builtin_search
   - search_key: ""
   - owner_ids: [user_open_id]
4. Display documents created by that user
markdown
1. 用户: "张三创建的所有文档"
2. 首先获取用户ID: mcp__lark__contact_v3_user_batchGetId
   - emails: ["zhangsan@company.com"]
3. 然后搜索: mcp__lark__docx_builtin_search
   - search_key: ""
   - owner_ids: [user_open_id]
4. 显示该用户创建的文档

Examples (示例)

示例

Example 1: Basic Search (基础搜索)

示例1:基础搜索

User (Chinese):
帮我搜索包含'季度OKR'的文档
Assistant Response:
markdown
I'll search for documents containing '季度OKR'.

<uses mcp__lark__docx_builtin_search>
- search_key: "季度OKR"
- count: 10

Found 3 documents:

1. **2024 Q4 OKR Review** (docx)
   - Owner: 张三
   - Updated: 2024-01-10
   - Link: https://example.feishu.cn/docx/abc123

2. **Team OKR Template** (docx)
   - Owner: 李四
   - Updated: 2024-01-08
   - Link: https://example.feishu.cn/docx/def456

3. **Q1 2025 OKR Planning** (sheet)
   - Owner: 王五
   - Updated: 2024-01-12
   - Link: https://example.feishu.cn/sheets/ghi789

Would you like me to open any of these documents?
用户(中文):
帮我搜索包含'季度OKR'的文档
助手回复:
markdown
I'll search for documents containing '季度OKR'.

<uses mcp__lark__docx_builtin_search>
- search_key: "季度OKR"
- count: 10

Found 3 documents:

1. **2024 Q4 OKR Review** (docx)
   - Owner: 张三
   - Updated: 2024-01-10
   - Link: https://example.feishu.cn/docx/abc123

2. **Team OKR Template** (docx)
   - Owner: 李四
   - Updated: 2024-01-08
   - Link: https://example.feishu.cn/docx/def456

3. **Q1 2025 OKR Planning** (sheet)
   - Owner: 王五
   - Updated: 2024-01-12
   - Link: https://example.feishu.cn/sheets/ghi789

Would you like me to open any of these documents?

Example 2: Get Document Content (获取文档内容)

示例2:获取文档内容

User (English):
Get the content of this document: https://example.feishu.cn/docx/abc123
Assistant Response:
markdown
I'll retrieve the content of that document.

<uses mcp__lark__docx_v1_document_rawContent>
- document_id: abc123

Here's the document content:
用户(英文):
Get the content of this document: https://example.feishu.cn/docx/abc123
助手回复:
markdown
I'll retrieve the content of that document.

<uses mcp__lark__docx_v1_document_rawContent>
- document_id: abc123

Here's the document content:

2024 Q4 OKR Review

2024 Q4 OKR Review

Engineering Team

Engineering Team

Objective 1: Improve System Reliability

Objective 1: Improve System Reliability

  • KR1: Achieve 99.9% uptime ✓ (Completed: 99.95%)
  • KR2: Reduce MTTR to under 30 minutes ✓ (Completed: 25 min)
  • KR3: Complete disaster recovery testing ⚠ (In Progress: 80%)
  • KR1: Achieve 99.9% uptime ✓ (Completed: 99.95%)
  • KR2: Reduce MTTR to under 30 minutes ✓ (Completed: 25 min)
  • KR3: Complete disaster recovery testing ⚠ (In Progress: 80%)

Objective 2: Enhance Developer Productivity

Objective 2: Enhance Developer Productivity

  • KR1: Reduce build time by 40% ✓ (Completed: 45% reduction)
  • KR2: Implement automated code review ✓ (Completed)
  • KR3: Launch internal developer portal ✗ (Delayed to Q1 2025)
[... more content ...]
Would you like me to summarize the key points or search for related documents?
undefined
  • KR1: Reduce build time by 40% ✓ (Completed: 45% reduction)
  • KR2: Implement automated code review ✓ (Completed)
  • KR3: Launch internal developer portal ✗ (Delayed to Q1 2025)
[... more content ...]
Would you like me to summarize the key points or search for related documents?
undefined

Example 3: Wiki Search (知识库搜索)

示例3:知识库搜索

User (Chinese):
在工程知识库中搜索关于'微服务架构'的文档
Assistant Response:
markdown
我会在工程知识库中搜索'微服务架构'相关内容。

<uses mcp__lark__wiki_v1_node_search>
- query: "微服务架构"

找到 5 个相关页面:

1. **微服务架构设计指南**
   - 路径: 工程文档 > 架构设计 > 微服务
   - 更新时间: 2024-01-10
   - [查看页面](https://example.feishu.cn/wiki/page1)

2. **服务拆分最佳实践**
   - 路径: 工程文档 > 架构设计 > 最佳实践
   - 更新时间: 2024-01-08
   - [查看页面](https://example.feishu.cn/wiki/page2)

3. **API Gateway 配置说明**
   - 路径: 工程文档 > 基础设施 > 网关
   - 更新时间: 2024-01-12
   - [查看页面](https://example.feishu.cn/wiki/page3)

需要我打开其中某个页面查看详细内容吗?
用户(中文):
在工程知识库中搜索关于'微服务架构'的文档
助手回复:
markdown
我会在工程知识库中搜索'微服务架构'相关内容。

<uses mcp__lark__wiki_v1_node_search>
- query: "微服务架构"

找到 5 个相关页面:

1. **微服务架构设计指南**
   - 路径: 工程文档 > 架构设计 > 微服务
   - 更新时间: 2024-01-10
   - [查看页面](https://example.feishu.cn/wiki/page1)

2. **服务拆分最佳实践**
   - 路径: 工程文档 > 架构设计 > 最佳实践
   - 更新时间: 2024-01-08
   - [查看页面](https://example.feishu.cn/wiki/page2)

3. **API Gateway 配置说明**
   - 路径: 工程文档 > 基础设施 > 网关
   - 更新时间: 2024-01-12
   - [查看页面](https://example.feishu.cn/wiki/page3)

需要我打开其中某个页面查看详细内容吗?

Important Notes

重要说明

Permission Boundaries (权限边界)

权限边界

  • All operations respect the user's actual Lark permissions
  • If a document is not accessible, you'll receive a permission error
  • Cannot access private documents or groups the user is not a member of
  • 所有操作均遵循用户的实际Lark权限
  • 如果文档不可访问,会收到权限错误提示
  • 无法访问用户未加入的私有文档或群组

Document ID Extraction (文档ID提取)

文档ID提取

Document URLs have this format:
  • Docx:
    https://*.feishu.cn/docx/{document_id}
  • Wiki:
    https://*.feishu.cn/wiki/{wiki_token}
  • Sheets:
    https://*.feishu.cn/sheets/{spreadsheet_id}
  • Bitable:
    https://*.feishu.cn/base/{app_token}
Extract the ID/token from the URL when accessing content.
文档URL格式如下:
  • Docx:
    https://*.feishu.cn/docx/{document_id}
  • Wiki:
    https://*.feishu.cn/wiki/{wiki_token}
  • Sheets:
    https://*.feishu.cn/sheets/{spreadsheet_id}
  • Bitable:
    https://*.feishu.cn/base/{app_token}
访问内容时,从URL中提取ID/令牌。

Search Limitations (搜索限制)

搜索限制

  • Maximum 50 results per search (count parameter)
  • Use pagination (offset) for more results
  • Search is case-insensitive
  • Results are sorted by relevance
  • 每次搜索最多返回50条结果(通过count参数设置)
  • 使用分页(offset)获取更多结果
  • 搜索不区分大小写
  • 结果按相关性排序

Content Format (内容格式)

内容格式

  • docx_v1_document_rawContent
    returns plain text (no formatting)
  • @mentions are converted to display names based on lang parameter
  • For rich formatted content, use the API to get structured data
  • docx_v1_document_rawContent
    返回纯文本(无格式)
  • 根据lang参数,@提及对象会转换为显示名称
  • 如需富格式内容,使用API获取结构化数据

Error Handling

错误处理

Common errors and solutions:
  1. "Permission denied" (权限被拒绝)
    • The user doesn't have access to this document
    • Ask the document owner to grant permission
  2. "Document not found" (文档未找到)
    • Document ID is invalid or document was deleted
    • Verify the document URL is correct
  3. "Invalid token" (无效令牌)
    • MCP server authentication failed
    • Check LARK_APP_ID and LARK_APP_SECRET environment variables
    • Ensure OAuth token is valid
常见错误及解决方案:
  1. "Permission denied"(权限被拒绝)
    • 用户无该文档访问权限
    • 请联系文档所有者授予权限
  2. "Document not found"(文档未找到)
    • 文档ID无效或文档已被删除
    • 确认文档URL正确
  3. "Invalid token"(无效令牌)
    • MCP服务器认证失败
    • 检查LARK_APP_ID和LARK_APP_SECRET环境变量
    • 确保OAuth令牌有效

Tips for Effective Use

高效使用技巧

  1. Start with search: Use keyword search before asking for specific documents
  2. Be specific: Include relevant keywords to narrow down results
  3. Use filters: Filter by document type or owner to find documents faster
  4. Check permissions: Verify access before trying to read document content
  5. Bilingual support: Works with both Chinese and English queries
  1. 从搜索开始:在请求特定文档前,先使用关键词搜索
  2. 明确具体:包含相关关键词以缩小结果范围
  3. 使用筛选器:按文档类型或所有者筛选,更快找到文档
  4. 检查权限:在尝试读取文档内容前,先验证访问权限
  5. 双语支持:支持中文和英文查询

Related Skills

相关技能

  • lark-messages
    : Access Lark messages and groups
  • Future:
    lark-approval
    ,
    lark-calendar
    ,
    lark-drive
  • lark-messages
    : 访问Lark消息和群组
  • 未来计划:
    lark-approval
    lark-calendar
    lark-drive