SuperAPI AI Directory

feishu-fetch-doc

Office & productivity

View repository

Updated 10-15 23:48

About this skill

feishu_mcp_fetch_doc

Get the Markdown content of a Feishu cloud document (Lark-flavored format).

Important: Handling of images, files, and whiteboards

Images, files, and whiteboards in the document need to be obtained separately via the feishu_doc_media(action: download) tool!

Recognizing the format

In the returned Markdown, media files appear as HTML tags:

  • Image:
    <image token="Z1FjxxxxxxxxxxxxxxxxxxxtnAc" width="1833" height="2491" align="center"/>
    
  • File:

    <view type="1">
      <file token="Z1FjxxxxxxxxxxxxxxxxxxxtnAc" name="skills.zip"/>
    </view>
    
  • Whiteboard:

    <whiteboard token="Z1FjxxxxxxxxxxxxxxxxxxxtnAc"/>
    

Retrieval steps

  1. Extract the token attribute value from the HTML tag
  2. Call feishu_doc_media to download:
    {
      "action": "download",
      "resource_token": "提取的token",
      "resource_type": "media",
      "output_path": "/path/to/save/file"
    }
    

Parameters

  • doc_id(required): supports passing the document URL or token directly
    • Pass URL directly:https://xxx.feishu.cn/docx/Z1FjxxxxxxxxxxxxxxxxxxxtnAc(the system automatically extracts the token)
    • Pass token directly:Z1FjxxxxxxxxxxxxxxxxxxxtnAc
    • Wiki URL/token is also supported:https://xxx.feishu.cn/wiki/Z1FjxxxxxxxxxxxxxxxxxxxtnAc or Z1FjxxxxxxxxxxxxxxxxxxxtnAc

Wiki URL handling strategy

A wiki link (/wiki/TOKEN) may point to different types of documents such as cloud documents, spreadsheets, or bitables. When the type is uncertain, you must not directly assume it is a cloud document, and you must first query the actual type.

Handling process

  1. First call feishu_wiki_space_node(action: get) to resolve the wiki token:
    { "action": "get", "token": "wiki_token_here" }
    
  2. From the returned node , obtain obj_type(the actual document type) and obj_token(the actual document token)
  3. Based on obj_type , call the corresponding tool:
obj_type Tool Parameters
docx feishu_mcp_fetch_doc doc_id = obj_token
sheet feishu_sheet spreadsheet_token = obj_token
bitable feishu_bitable_* series app_token = obj_token
Other Inform the user that this type is not currently supported —

Example

User:帮我看下这个文档 https://xxx.feishu.cn/wiki/ABC123

  1. Call feishu_wiki_space_node(action: get, token: ABC123)
  2. returns obj_type: "docx", obj_token: "doxcnXYZ789"
  3. Call feishu_mcp_fetch_doc(doc_id: doxcnXYZ789)

Tool combinations

Requirement Tool
Get document text feishu_mcp_fetch_doc
Download images/files/whiteboards feishu_doc_media(action: download)
Resolve wiki token type feishu_wiki_space_node(action: get)
Read and write spreadsheets feishu_sheet
Operate bitables feishu_bitable_* series