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
- Extract the
tokenattribute value from the HTML tag - Call
feishu_doc_mediato 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/Z1FjxxxxxxxxxxxxxxxxxxxtnAcorZ1FjxxxxxxxxxxxxxxxxxxxtnAc
- Pass URL directly:
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
- First call
feishu_wiki_space_node(action: get) to resolve the wiki token:{ "action": "get", "token": "wiki_token_here" } - From the returned
node, obtainobj_type(the actual document type) andobj_token(the actual document token) - 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
- Call
feishu_wiki_space_node(action: get, token: ABC123) - returns
obj_type: "docx",obj_token: "doxcnXYZ789" - 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 |