Skip to main content
Glama

manage_doc_block

Manage document blocks in Feishu: create, update, delete blocks including tables, images, files, and generic content.

Instructions

[Official API] Manage content blocks in a document. Single tool replaces v1.3.6 create_doc_block / update_doc_block / delete_doc_blocks. action=create — six modes (pass exactly ONE): (A) Generic — pass children array (e.g. [{block_type:2, text:{...}}]). (B) Image from local file — pass image_path; plugin uploads and patches. (C) Image from token — pass image_token (already uploaded). (D) File attachment from local file — pass file_path; plugin handles VIEW-wrap + replace_file. (E) File from token — pass file_token. (F) Table — pass table={rows,columns,cells?}; plugin creates a block_type=31 table (Feishu auto-makes the block_type=32 cells) and fills each provided cell. USE THIS for tables — do NOT hand-build table blocks via children (the table block_type is 31, NOT 40; getting it wrong returns invalid_param). action=update — generic (pass update_body), image-replace (pass image_token), or file-replace (pass file_token). ⚠ update_text_elements REPLACES the block's ENTIRE elements array — it is a full overwrite, NOT a patch/append. Any element you omit (bold runs, links, prefixes) is permanently lost; to change part of a block, read it first (get_doc_blocks) and resend ALL elements. action=delete — pass parent_block_id + start_index + end_index (range delete). document_id accepts native ID, wiki node token, or Feishu URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNoInsert position for create (optional, appends to end if omitted).
tableNoCreate a table — create mode F (mutually exclusive with other create modes). Shape: {rows:int>=1, columns:int>=1, cells?:string[][] (row-major plain text; omit/empty-string to leave a cell blank), column_width?:int[] (px, length=columns), header_row?:bool, header_column?:bool}. The plugin creates a block_type=31 table, lets Feishu auto-create the cells, and fills each provided cell by updating its text — you never specify block types. Returns {tableBlockId, cells:[[cellId,...]] (row-major grid), filled, failedCells?}. Cell fills auto-retry transient Feishu errors with backoff; cells that still fail do NOT abort the call — they are listed in failedCells:[{row,col,cellId,textBlockId?,reason,skipped?}] (0-based row/col) so you can repair each via action=update on its textBlockId (or action=create into its cellId). Example: {"rows":2,"columns":2,"cells":[["Name","Role"],["Ann","PM"]]}.
actionYesOperation to perform
block_idNoBlock ID — required for action=update.
childrenNoGeneric blocks for create mode A. E.g. [{block_type:2, text:{elements:[{text_run:{content:"Hello"}}]}}]
end_indexNoRange end (exclusive) — required for delete.
file_pathNoLocal file path — create mode D (mutually exclusive with other create modes).
file_tokenNoPre-uploaded docx file token — create mode E, or update file-replace.
image_pathNoLocal image path — create mode B (mutually exclusive with other create modes).
document_idYesDocument ID, wiki node token, or Feishu URL (required for all actions)
image_tokenNoPre-uploaded docx image token — create mode C, or update image-replace.
start_indexNoRange start (inclusive) — required for delete.
update_bodyNoGeneric update payload for action=update. E.g. {update_text_elements:{elements:[{text_run:{content:"new text"}}]}}. ⚠ update_text_elements is a FULL REPLACEMENT of the block's elements array (not patch/append) — include every element you want to keep, or the omitted ones are permanently lost.
parent_block_idNoParent block ID — required for create/delete (use document_id for the doc root).
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses critical behaviors: update_text_elements is a full overwrite, table creation lets Feishu auto-create cells, cell fills auto-retry with backoff, and failed cells are listed in failedCells without aborting. The document_id accepted formats are also disclosed. No contradiction with annotations exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but densely structured with action= sections, labeled modes (A-F), and bold warnings. Every sentence carries diagnostic value; the complexity of a 14-parameter multi-action tool justifies the length and organization.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity, no output schema, and no annotations, the description is remarkably complete: it covers all actions, parameter combinations, return data for table mode, error handling behavior, and update warnings. It leaves no significant gap for an agent to invoke the tool successfully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds substantial parameter semantics: mode-to-parameter mapping, mutual exclusivity between create modes, table shape constraints, and concrete examples. It clarifies update_body replacement semantics beyond the schema's description, which is high added value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it manages content blocks in a document and explicitly replaces create_doc_block/update_doc_block/delete_doc_blocks. The three actions (create, update, delete) and their modes give precise, specific purpose that distinguishes it from sibling tools like get_doc_blocks and read_doc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance on when to use each action and mode, including when to use table mode versus hand-building blocks, and warns to read the block first with get_doc_blocks before using update_text_elements. It also names the legacy tools it replaces, giving clear alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EthanQC/feishu-user-plugin'

If you have feedback or need assistance with the MCP directory API, please join our Discord server