SuperAPI AI Directory

feishu-create-doc

General & other

View repository

Updated 10-15 23:48

About this skill

feishu_mcp_create_doc

Call via MCP create-docto create a new Feishu cloud document from Lark-flavored Markdown content.

Return value

After the tool executes successfully, it returns a JSON object containing the following fields:

  • doc_id(string): The unique identifier (token) of the document, in a format such as doxcnXXXXXXXXXXXXXXXXXXX
  • doc_url(string): The access link of the document, which can be opened directly in a browser, in a format such as https://www.feishu.cn/docx/doxcnXXXXXXXXXXXXXXXXXXX
  • message(string): The operation result message, such as "Document created successfully"
Parameters

markdown (required)

The Markdown content of the document, using the Lark-flavored Markdown format.

The markdown content used when calling this tool should be as clearly structured, richly styled, and highly readable as possible. Reasonably use capabilities such as callout highlight blocks, columns, and tables, and reasonably use the ability to insert images and mermaid to achieve a rich combination of text and images.. You need to follow these principles:

  • Clear structure: Heading levels ≤ 4 levels, use Callout to highlight key information
  • Visual rhythm: Use dividers, columns, and tables to break up large blocks of plain text
  • Integration of text and images: Prioritize Mermaid/PlantUML visualization for processes and architecture
  • Restrained whitespace: Do not overuse Callout, and bold only core words

When users have clear style or formatting requirements, the user's requirements should take precedence!!

Important notes:

  • Do not repeat the title: Do not write a level-1 heading at the beginning of the markdown content that is the same as the title! The title parameter is already the document title, and markdown should start directly from the body content
  • Table of contents: Automatically generated by Feishu, no need to add manually
  • Markdown syntax must conform to the Lark-flavored Markdown specification; see the "Content format" section below for details
  • When creating longer documents, it is strongly recommended to use append mode in update-doc to create in sections and improve the success rate.

title (optional)

Document title.

folder_token (optional)

The token of the parent folder. If not provided, the document will be created in the root directory of the user's personal space.

folder_token can be obtained from the Feishu folder URL, in a format such as:https://xxx.feishu.cn/drive/folder/fldcnXXXX, where fldcnXXXX is the folder_token.

wiki_node (optional)

Knowledge base node token or URL (optional; if passed, the document will be created under that node, mutually exclusive with folder_token and wiki_space)

wiki_node can be obtained from the Feishu knowledge base page URL, in a format such as:https://xxx.feishu.cn/wiki/wikcnXXXX, where wikcnXXXX is the wiki_node token.

wiki_space (optional)

Knowledge space ID (optional; if passed, the document will be created in the root directory of that space. The special value my_library indicates the user's personal knowledge base. Mutually exclusive with wiki_node and folder_token)

wiki_space can be obtained from the knowledge space settings page URL, in a format such as:https://xxx.feishu.cn/wiki/settings/7448000000000009300, where 7448000000000009300 is the wiki_space ID.

Parameter priority:wiki_node > wiki_space > folder_token

Examples

Example 1: Create a simple document

{
  "title": "项目计划",
  "markdown": "# 项目概述\n\n这是一个新项目。\n\n## 目标\n\n- 目标 1\n- 目标 2"
}

Example 2: Create in a specified folder

{
  "title": "会议纪要",
  "folder_token": "fldcnXXXXXXXXXXXXXXXXXXXXXX",
  "markdown": "# 周会 2025-01-15\n\n## 讨论议题\n\n1. 项目进度\n2. 下周计划"
}

Example 3: Use Feishu extended syntax

Use Feishu-specific features such as callouts and tables:

{
  "title": "产品需求",
  "markdown": "<callout emoji=\"💡\" background-color=\"light-blue\">\n重要需求说明\n</callout>\n\n## 功能列表\n\n<lark-table header-row=\"true\">\n| 功能 | 优先级 |\n|------|--------|\n| 登录 | P0 |\n| 导出 | P1 |\n</lark-table>"
}

Example 4: Create under a wiki node

{
  "title": "技术文档",
  "wiki_node": "wikcnXXXXXXXXXXXXXXXXXXXXXX",
  "markdown": "# API 接口说明\n\n这是一个知识库文档。"
}

Example 5: Create in the root directory of a wiki space

{
  "title": "项目概览",
  "wiki_space": "7448000000000009300",
  "markdown": "# 项目概览\n\n这是知识空间根目录下的一级文档。"
}

Example 6: Create in a personal wiki

{
  "title": "学习笔记",
  "wiki_space": "my_library",
  "markdown": "# 学习笔记\n\n这是创建在个人知识库中的文档。"
}
Content format

Document content uses the Lark-flavored Markdown format, which is an extended version of standard Markdown and supports all block types and rich text formats of Feishu documents.

General rules

  • Use standard Markdown syntax as the foundation
  • Use custom XML tags to implement Feishu-specific features (see each feature section for specific tags)
  • Use a backslash to escape special characters when they need to be displayed:* ~ $ [ ] < > { } | ^`

📝 Basic block types

Text (paragraph)

普通文本段落

段落中的**粗体文字**

多个段落之间用空行分隔。

居中文本 {align="center"}
右对齐文本 {align="right"}

Paragraph alignment: supports {align="left|center|right"} syntax. Can be combined with color:{color="blue" align="center"}

Headings

Feishu supports 9 levels of headings. H1-H6 use standard Markdown syntax, and H7-H9 use HTML tags:

# 一级标题
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题
<h7>七级标题</h7>
<h8>八级标题</h8>
<h9>九级标题</h9>

# 带颜色的标题 {color="blue"}
## 红色标题 {color="red"}
# 居中标题 {align="center"}
## 蓝色居中标题 {color="blue" align="center"}

Heading attributes: supports {color="颜色名"} and {align="left|center|right"} syntax, and they can be used in combination. Color values: red, orange, yellow, green, blue, purple, gray. Please use this capability with caution.

Lists

For nested ordered lists and unordered lists, use tab or 2-space indentation

- 无序项1(
  - 无序项1.a
  - 无序项1.b

1. 有序项1
2. 有序项2

- [ ] 待办
- [x] 已完成

Quote block

> 这是一段引用
> 可以跨多行

> 引用中支持**加粗**和*斜体*等格式

Code block

⚠️ Only fenced code blocks are supported (```), indented code blocks are not supported.

```python
print("Hello")
```

Supported languages: python, javascript, go, java, sql, json, yaml, shell, etc.

Divider

---

🎨 Rich text formats

Text styles

**粗体** *斜体* ~~删除线~~ `行内代码` <u>下划线</u>

Text color

<text color="red">红色</text> <text background-color="yellow">黄色背景</text>

Supported: red, orange, yellow, green, blue, purple, gray

Links

[链接文字](https://example.com) (anchor links are not supported)

Inline formula (LaTeX)

$E = mc^2$($requires spaces before and after) or <equation>E = mc^2</equation>(no restrictions, recommended)


🚀 Advanced block types

Callout

<callout emoji="✅" background-color="light-green" border-color="green">
支持**格式化**的内容,可包含多个块
</callout>

Attributes: emoji (use emoji characters such as ✅ ⚠️ 💡), background-color, border-color, text-color

Background color: light-red/red, light-blue/blue, light-green/green, light-yellow/yellow, light-orange/orange, light-purple/purple, pale-gray/light-gray/dark-gray

Common: 💡light-blue(tip) ⚠️light-yellow(warning) ❌light-red(danger) ✅light-green(success)

Restrictions: callout child blocks only support text, headings, lists, to-dos, and quotes. Code blocks, tables, and images are not supported.

Columns (Grid)

Suitable for comparison and side-by-side display scenarios. Supports 2-5 columns:

Two columns (equal width)

<grid cols="2">
<column>

左栏内容

</column>
<column>

右栏内容

</column>
</grid>

Three columns with custom widths

<grid cols="3">
<column width="20">左栏(20%)</column>
<column width="60">中栏(60%)</column>
<column width="20">右栏(20%)</column>
</grid>

Attributes: cols(number of columns 2-5), width(column width percentage, the total is 100, can be omitted when equal width)

Tables

Standard Markdown table

| 列 1 | 列 2 | 列 3 |
|------|------|------|
| 单元格 1 | 单元格 2 | 单元格 3 |
| 单元格 4 | 单元格 5 | 单元格 6 |

Feishu enhanced table

Use when cells need complex content (lists, code blocks, callouts, etc.).

Hierarchical structure(must be strictly followed):

<lark-table>                    ← 表格容器
  <lark-tr>                     ← 行(直接子元素只能是 lark-tr)
    <lark-td>内容</lark-td>     ← 单元格(直接子元素只能是 lark-td)
    <lark-td>内容</lark-td>     ← 每行的 lark-td 数量必须相同!
  </lark-tr>
</lark-table>

Attributes:

  • column-widths: column widths, comma-separated pixel values, total width ≈730
  • header-row: whether the first row is a header ("true" or "false")
  • header-column: whether the first column is a header ("true" or "false")

Cell syntax: there must be blank lines before and after the content

<lark-td>

这里写内容

</lark-td>

Complete example(2 rows, 3 columns):

<lark-table column-widths="200,250,280" header-row="true">
<lark-tr>
<lark-td>

**表头1**

</lark-td>
<lark-td>

**表头2**

</lark-td>
<lark-td>

**表头3**

</lark-td>
</lark-tr>
<lark-tr>
<lark-td>

普通文本

</lark-td>
<lark-td>

- 列表项1
- 列表项2

</lark-td>
<lark-td>

代码内容

</lark-td>
</lark-tr>
</lark-table>

Restriction: Grid and nested tables are not supported inside cells

Merged cells: Returns the rowspan/colspan property on read; creation is not supported yet

Prohibited:

  • Mixing Markdown table syntax (|---|)
  • Use <br/> for line breaks
  • Omitting <lark-td> tags

Images

<image url="https://example.com/image.png" width="800" height="600" align="center" caption="图片描述文字"/>

Properties: url (required, the system will automatically download and upload), width, height, align (left/center/right), caption

⚠️ Important: Direct use of the token property is not supported (such as <image token="xxx"/>); only the URL method is supported. The system will automatically download the image and upload it to Feishu.

Supports PNG/JPG/GIF/WebP/BMP, maximum 10MB

Choosing the image/file insertion method:

  • Have a publicly accessible image URL → Use it directly in the markdown of create-doc / update-doc <image url="..."/> in one step

  • Local image or file(such as an image/file sent by the user in chat) → First use create-doc / update-doc to create or update the document text content, then use the feishu_doc_media tool to append the local image or file to the end of the document. If the media needs to appear at a specific position in the middle of the document, you can first use create-doc to write the preceding content, call feishu_doc_media to append the image/file, and finally use update-doc's append mode to append the subsequent content

Files

<file url="https://example.com/document.pdf" name="文档.pdf" view-type="1"/>

Properties:

  • url (file URL, required, the system will automatically download and upload)
  • name (file name, required)
  • view-type (1=card view, 2=preview view, optional)

⚠️ Important: Direct use of the token property is not supported (such as <file token="xxx"/>)

Whiteboard (Mermaid / PlantUML diagrams)

Two diagram syntaxes are supported: Mermaid and PlantUML.

Mermaid diagrams

Prefer this format for diagrams. Mermaid diagrams will be rendered as a visual whiteboard. If a diagram can be implemented with mermaid, mermaid should be preferred.

```mermaid
graph TD
    A[开始] --> B{判断}
    B -->|是| C[处理]
    B -->|否| D[结束]
```

Supported diagram types: flowchart, sequenceDiagram, classDiagram, stateDiagram, gantt, mindmap, erDiagram

PlantUML diagrams

PlantUML diagrams will be rendered as a visual whiteboard. For scenarios that mermaid cannot satisfy, you can choose PlantUML for drawing.

```plantuml
@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi!
@enduml
```

Supported diagram types: sequence, usecase, class, activity, component, state, object, deployment

Reading whiteboards

Returns the <whiteboard> tag on read:

<whiteboard token="xxx" align="center" width="800" height="600"/>

Properties: token (whiteboard identifier), align (left/center/right), width, height

Important notes:

  • When using create-doc, use a Mermaid/PlantUML code block, and the system will automatically convert it into a whiteboard; writing in the form of<whiteboard>is prohibited!!
  • On read, only the token can be obtained; the content can be viewed via the fetch-file tool. The original source code cannot be obtained

Bitable

<bitable view="table"/>
<bitable view="kanban"/>

Properties: view (table/kanban, default table)

Note: token is a read-only property and cannot be specified at creation; only an empty Bitable can be created, and data must be added manually afterward.

ChatCard

<chat-card id="oc_xxx" align="center"/>

Properties: id (format oc_xxx, required), align (left/center/right)

Iframe

<iframe url="https://example.com/survey?id=123" type="12"/>

Properties: url (required), type (component type number, required)

type enum: 1=Bilibili, 2=Xigua, 3=Youku, 4=Airtable, 5=Baidu Maps, 6=Amap, 8=Figma, 9=MockingBot, 10=Canva, 11=CodePen, 12=Feishu Forms, 13=Jinshuju

Important note: only the web page types listed above are supported. Other types of web pages do not support embedding, so do not use iframe. For ordinary web page links, use the Markdown link format [链接文字](URL) instead.

Link preview (LinkPreview)

<link-preview url="消息链接" type="message"/>

Attributes: url (required, attribute only), type (message=message link)

Currently only message links are supported, and only reading is supported; creation is not supported

Quote container (QuoteContainer)

<quote-container>
引用容器内容
</quote-container>

Unlike the quote block, the quote container is a container type and can contain multiple child blocks


🔧 Advanced feature blocks

Spreadsheet (Sheet)

<sheet rows="5" cols="5"/>
<sheet/>

Attributes: rows (number of rows, default 3, maximum 9), cols (number of columns, default 3)

Note: token is a read-only attribute and cannot be specified at creation time. Only an empty spreadsheet can be created; after creation, use the Sheet API to operate on the data.

Read-only block types 🔒

The following block types support reading only and do not support creation:

Block type Tag Description
Mind note <mindnote token="xxx"/> Only placeholder information is obtained
Flowchart/UML <diagram type="1"/> type: 1=flowchart, 2=UML
AI template <ai-template/> Contentless placeholder block

Task block

<task task-id="xxx" members="ou_123, ou_456" due="2025-01-01">任务标题</task>

Attributes: task-id, members (member ID list), due (due date)

Synced block

<!-- 源同步块:内容在子块中 -->
<source-synced align="1">子块内容...</source-synced>

<!-- 引用同步块:自动获取源文档内容 -->
<reference-synced source-block-id="xxx" source-document-id="yyy">源内容...</reference-synced>

Attributes: source-synced has align; reference-synced has source-block-id, source-document-id

Document add-ons (AddOns)

<add-ons component-type-id="blk_xxx" record='{"key":"value"}'/>

Attributes: component-type-id (add-on type ID), record (JSON data)

Includes multiple types: Q&A interaction, date reminders, etc. Some components such as Mermaid have been specially encapsulated as board blocks

Legacy add-ons (ISV)

<isv id="comp_xxx" type="type_xxx"/>

Attributes: component_id, component_type_id

Legacy open platform add-ons; for the new version, please use AddOns

Wiki subdirectory (WikiCatalog) 🕰️

<wiki-catalog token="wiki_xxx"/>

Attributes: wiki_token (wiki node token)

🕰️ Legacy version; it is recommended to use the new version sub-page-list

Wiki subpage list (SubPageList)

<sub-page-list wiki="wiki_xxx"/>

Attributes: wiki_token (wiki token of the current page)

Only wiki document creation is supported, and the wiki token of the current page must be passed in

Agenda (Agenda)

<agenda>
  <agenda-item>
    <agenda-title>议程标题</agenda-title>
    <agenda-content>议程内容</agenda-content>
  </agenda-item>
</agenda>

Structure: agenda (container) → agenda_item (agenda item) → agenda_title (title) + agenda_content (content)

Jira issue (JiraIssue)

<jira-issue id="xxx" key="PROJECT-123"/>

Attributes: id (Jira issue ID), key (Jira issue Key)

OKR series⚠️

<okr id="okr_xxx">
  <objective id="obj_1">
    <kr id="kr_1"/>
  </objective>
</okr>

⚠️ Only user_access_token creation is supported, and the OKR API must be used for detailed operations

Structure: okr → okr_objective (objective) → okr_key_result (key result) + okr_progress (progress)


📎 Mentions and references

Mention user

<mention-user id="ou_xxx"/>

Attributes: id (user open_id, format ou_xxx)

Note: do not write it directly in the document@张三 format like this; you should use search-user to get the user's id, and usemention-user.

mention document

<mention-doc token="doxcnXXX" type="docx">文档标题</mention-doc>

Property: token (document token), type (docx/sheet/bitable)


📅 Date and Time

Date Reminder (Reminder)

<reminder date="2025-12-31T18:00+08:00" notify="true" user-id="ou_xxx"/>

Property:

  • date (required): YYYY-MM-DDTHH:mm+HH:MM, ISO 8601 with timezone offset
  • notify (true/false): whether to send a notification
  • user-id (required): creator user ID

📐 Mathematical Expressions

Block-level formula (LaTeX)

$$
\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

Inline formula

爱因斯坦方程:$E = mc^2$(注意 $ 前后需空格,紧邻位置不能有空格)

✍️ Writing Guide

Scenario Quick Reference

Scenario Recommended Component Description
Key tips/warnings Callout Blue tip, yellow warning, red danger
Comparison/side-by-side display Grid columns 2-3 columns is best; more eye-catching with Callout
Data summary Table Use Markdown for simple cases, lark-table for complex nesting
Step description Ordered list Can nest substeps
Timeline/version Ordered list + bold dates Or use Mermaid timeline
Code display Code block Label the language, add comments as appropriate
Knowledge card Callout + emoji For concept explanations and tips
Citation note Quote block > Quote original text and famous sayings
Term comparison Two-column table Chinese-English, abbreviation and full name, etc.

🎯 Best Practices

  • Blank line separation: separate different block types with blank lines
  • Escape characters: escape special characters with \ :\* \~ ```
  • Images: use URLs; the system automatically downloads and uploads them
  • Columns: the sum of column widths must be 100
  • Table selection: use Markdown for simple data, and <lark-table>
  • Mentions: for @user use <mention-user>, for @document use <mention-doc>
  • Table of contents: automatically generated by Feishu, no need to add manually

📖 Additional Notes

  • Images, whiteboards, and Bitable require a token (URLs are automatically uploaded and converted)
  • Mentioning users and session cards require the corresponding access permissions
  • Fully compatible with standard Markdown