Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
bytedance avatar

Byted Viking Aisearch Feishu

  • 19 installs
  • 411 repo stars
  • Updated August 4, 2026
  • bytedance/agentkit-samples

viking-aisearch-feishu is a read-only Claude skill that searches and reads Feishu (Lark) docs, sheets, bitable and wiki via the Feishu Open Platform API.

About

viking-aisearch-feishu is a read-only tool for searching and reading Feishu (Lark) cloud documents, spreadsheets, multidimensional tables (bitable) and wiki knowledge bases via the Feishu Open Platform API. It aggregates search across doc, docx, sheet, bitable and wiki types and reads their content, returning plain text, TSV or JSON summaries. A developer authenticates with a Lark user access token and uses the FeishuDocSearch class to find and pull document content. It strictly performs no write operations.

  • Aggregated search over Feishu docs, sheets, bitable and wiki
  • Reads doc content, sheet ranges and bitable records (read-only)
  • OAuth via a Lark user access token

Byted Viking Aisearch Feishu by the numbers

  • 19 all-time installs (skills.sh)
  • Ranked #1,308 of 2,715 Automation & Workflows skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

byted-viking-aisearch-feishu capabilities & compatibility

Requires a Feishu/Lark user OAuth access token with search permissions.

Capabilities
document search · content read · knowledge base search
Works with
confluence · notion
Use cases
web search · research · documentation
Pricing
Bring your own API key
From the docs

What byted-viking-aisearch-feishu says it does

你必须严格只读,不实现任何写操作。
SKILL.md
from scripts.feishu_search import FeishuDocSearch
SKILL.md
npx skills add https://github.com/bytedance/agentkit-samples --skill byted-viking-aisearch-feishu

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs19
repo stars411
Last updatedAugust 4, 2026
Repositorybytedance/agentkit-samples

What it does

Search and read Feishu docs, sheets, bases and wiki content read-only via the Lark API.

Who is it for?

Searching and reading Feishu/Lark documents and knowledge bases from an agent.

Skip if: Writing to or editing Feishu documents; it is strictly read-only.

When should I use this skill?

You need to search or read Feishu docs, sheets, bases or wiki content.

What you get

Search hits and document content returned as text, TSV or JSON from Feishu.

By the numbers

  • Searches six item types (doc, docx, sheet, bitable, wiki, wiki_space)

Files

SKILL.mdMarkdownGitHub ↗

Viking AISearch Feishu Skill

你是一个专注于飞书「云文档 / 电子表格 / 多维表格 / 知识库(Wiki)」的搜索与内容读取助手。你必须严格只读,不实现任何写操作。

🎯 核心功能

  • 搜索:聚合搜索云文档(doc/docx)、电子表格(sheet)、多维表格(bitable)、知识库空间与节点(wiki)
  • 读取:读取 doc/docx 原文;读取 sheet 预览区间数据;读取 bitable 表结构与记录样本;读取 wiki 节点(自动跳转到关联对象内容)与 wiki 空间子节点列表

🚦 场景路由

用户意图示例匹配场景主要方法产出
“搜一下飞书里关于‘Q4’的资料”聚合搜索search_items() / search_docs()返回条目列表(title/type/token/url/source…)
“读取这个 docx / sheet / base 的内容”内容读取fetch_raw_content()返回 content(纯文本/TSV/JSON 摘要)
“列出我有权限的知识库空间”知识库空间list_wiki_spaces() / search_wiki_spaces()返回空间列表
“列出某个知识库空间的子节点”空间子节点list_wiki_space_nodes()返回节点列表

📚 主要接口使用方法

1) 初始化

from scripts.feishu_search import FeishuDocSearch

# 方式一:使用环境变量(推荐)
# export LARK_USER_ACCESS_TOKEN="u-xxxxxxxxxxxxxxxxxxxxxxxx"
tool = FeishuDocSearch()

# 方式二:显式传入 access_token
tool = FeishuDocSearch(access_token="u-xxx")

2) 聚合搜索 - search_items()

功能:按关键词搜索云文档/电子表格/多维表格,并可选聚合知识库节点与知识库空间

参数

参数名类型必填默认值说明
search_keystr-搜索关键词
countint10返回数量(分页后)
offsetint0偏移量(分页后)
typesList[str]["doc","docx","sheet","bitable","wiki","wiki_space"]搜索类型集合
owner_idsList[str]None所有者 Open ID 过滤(仅 suite docs 搜索)
chat_idsList[str]None群聊 ID 过滤(仅 suite docs 搜索)
space_idstrNone仅搜索该知识库空间内节点(wiki 节点搜索)

返回语义

  • 只要至少一条搜索路径返回可用结果,search_items() 仍可返回 success=true
  • 若某一路径失败或降级,结果会在 data.warnings 中显式暴露,不再静默吞掉
  • 常见 warning 键包括:suite_errorsuite_fallback_errorwiki_nodes_errorwiki_spaces_errorwiki_spaces_warning

典型部分成功返回

{
  "success": true,
  "message": "搜索成功",
  "data": {
    "total": 3,
    "has_more": false,
    "items": [],
    "warnings": {
      "suite_error": {
        "message": "文档套件搜索失败",
        "error": {}
      }
    }
  }
}

3) 兼容接口 - search_docs()

search_docs() 为历史兼容接口,内部基于 search_items() 实现,默认包含 doc/docx/sheet/bitable/wiki

使用示例

# 基础搜索
result = tool.search_docs(search_key="项目计划")

# 指定类型搜索
result = tool.search_docs(
    search_key="季度报告",
    docs_types=["doc", "docx", "sheet", "bitable", "wiki"]
)

# 分页搜索
result = tool.search_docs(
    search_key="技术方案",
    count=20,
    offset=0
)

返回示例

{
  "success": true,
  "message": "搜索成功",
  "data": {
    "total": 12,
    "has_more": false,
    "warnings": {
      "wiki_error": {
        "message": "权限不足,请为应用开通 wiki 搜索相关权限",
        "error": {
          "type": "permission_denied",
          "detail": "HTTP 403: ..."
        }
      }
    },
    "items": [
      {
        "docs_token": "your_docs_token_xxx",
        "docs_type": "docx",
        "owner_id": "ou_xxx",
        "title": "项目计划.docx",
        "url": "https://xxx.feishu.com/docx/xxx",
        "source": "suite_docs"
      },
      {
        "docs_token": "your_docs_token_xxx",
        "docs_type": "wiki",
        "title": "用户操作手册",
        "url": "https://xxx.feishu.com/wiki/xxx",
        "space_id": "your_space_id_xxx",
        "obj_type": "docx",
        "obj_token": "your_obj_token_xxx",
        "source": "wiki_nodes"
      }
    ]
  }
}

3.5) 搜索 wiki 节点 - search_wiki_nodes()

功能:按 wiki 节点标题/内容搜索知识库文档

参数

参数名类型必填默认值说明
keywordstr-搜索关键词
countintNone返回数量
offsetintNone偏移量
space_idstrNone指定 wiki 知识空间

使用示例

result = tool.search_wiki_nodes(
    keyword="用户操作手册",
    space_id="your_space_id_xxx"
)

返回示例

{
  "success": true,
  "message": "搜索成功",
  "data": {
    "total": 1,
    "has_more": false,
    "items": [
      {
        "docs_token": "your_docs_token_xxx",
        "docs_type": "wiki",
        "title": "用户操作手册",
        "url": "https://xxx.feishu.com/wiki/xxx",
        "space_id": "your_space_id_xxx",
        "obj_type": "docx",
        "obj_token": "your_obj_token_xxx",
        "source": "wiki_nodes"
      }
    ]
  }
}

4) 内容读取 - fetch_raw_content()

支持的 docs_type

  • doc / docx:读取原文(raw_content)
  • sheet:读取表格预览区间数据(默认首个工作表 A1:Z100,可传 range_a1/max_rows/max_cols
  • bitable:读取多维表格的数据表列表,并读取一个数据表的记录样本(可传 table_id/page_size/page_token
  • wiki:读取知识库节点;若节点关联对象为 doc/docx/sheet/bitable,会自动读取关联对象内容
  • wiki_space:读取知识库空间的子节点列表(可分页)

补充说明

  • search_wiki_spaces() 命中分页上限时,会返回 data.has_more=true,并在 data.warnings.pagination_truncated 中说明结果可能不完整
  • fetch_sheet_content() 在 metainfo 端点失败但 query 端点成功时,仍返回 success=true,并在 data.warnings.metainfo_error 中保留降级信息
  • fetch_bitable_content() 在“表列表获取成功但记录样本读取失败”时,返回 success=truemessage=部分成功:已获取数据表列表,但记录样本读取失败,同时在 data.warnings.records_error 中暴露失败详情

使用示例

# 读取 docx
result = tool.fetch_raw_content(
    docs_type="docx",
    docs_token="your_docs_token_xxx"
)

# 读取 sheet(可指定范围)
sheet_result = tool.fetch_raw_content(
    docs_type="sheet",
    docs_token="your_sheet_token_xxx",
    range_a1="Sheet1!A1:D50"
)

# 读取 bitable(可指定表与分页)
base_result = tool.fetch_raw_content(
    docs_type="bitable",
    docs_token="your_app_token_xxx",
    table_id="tbl_xxx",
    page_size=50
)

返回示例(docx)

{
  "success": true,
  "message": "获取成功",
  "data": {
    "content": "Q4项目计划\n一、项目背景..."
  }
}

🔑 鉴权

  • 使用 Authorization: Bearer <LARK_USER_ACCESS_TOKEN>(用户访问令牌)
  • 访问令牌通过 viking_feishu_oauth_provider 注入到环境变量 LARK_USER_ACCESS_TOKEN,实现动态获取

📝 使用流程建议

典型流程:搜索并读取内容

# 1. 搜索
search_result = tool.search_docs(search_key="项目计划")
if not search_result.get("success"):
    print(search_result.get("message"))
    raise SystemExit

items = search_result.get("data", {}).get("items", [])
if not items:
    print("未找到相关文档")
    raise SystemExit

# 2. 获取第一个文档的 token 和类型
first_item = items[0]
docs_token = first_item["docs_token"]
docs_type = first_item["docs_type"]

# 3. 读取内容
content_result = tool.fetch_raw_content(docs_type=docs_type, docs_token=docs_token)
print(content_result)

📋 文档类型枚举

docs_type说明
doc旧版飞书文档
docx新版飞书文档
sheet电子表格
bitable多维表格
wiki飞书 wiki 节点(可自动读取关联对象内容)
wiki_space知识库空间(可读取子节点列表)

获取 wiki 节点信息 - get_wiki_node()

功能:获取 wiki 节点的详细信息,包括标题、关联对象类型等

使用示例

result = tool.get_wiki_node(node_token="your_node_token_xxx")

返回示例

{
  "success": true,
  "message": "获取成功",
  "data": {
    "node_token": "your_node_token_xxx",
    "title": "文档标题",
    "obj_type": "docx",
    "obj_token": "your_obj_token_xxx",
    "node_type": "origin",
    "space_id": "your_space_id_xxx",
    "creator": "ou_xxx",
    "owner": "ou_xxx"
  }
}

🚨 错误处理

错误类型识别方式返回提示
认证失败401/Unauthorized"认证失败,请检查 access_token 是否有效或已过期"
权限不足403/Forbidden"权限不足,请为应用开通搜索相关权限"
请求超时包含 timeout"请求超时,请稍后重试"
搜索参数错误search_key 为空"search_key 不能为空"
不支持的文档类型未知的 docs_type"不支持的 docs_type,仅支持 doc/docx/sheet/bitable/wiki/wiki_space"

Related skills

FAQ

Can this skill edit Feishu documents?

No, it is strictly read-only and implements no write operations.

What content types can it read?

It reads doc/docx text, sheet range data, bitable table structure and records, and wiki nodes and space child lists.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.