manage_doc_block
Create, update, or delete content blocks in a document. Supports generic blocks, images from local file or token, and file attachments from local file or token.
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 — five modes:
(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.
action=update — generic (pass update_body), image-replace (pass image_token), or file-replace (pass file_token).
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
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Operation to perform | |
| document_id | Yes | Document ID, wiki node token, or Feishu URL (required for all actions) | |
| block_id | No | Block ID — required for action=update. | |
| parent_block_id | No | Parent block ID — required for create/delete (use document_id for the doc root). | |
| index | No | Insert position for create (optional, appends to end if omitted). | |
| start_index | No | Range start (inclusive) — required for delete. | |
| end_index | No | Range end (exclusive) — required for delete. | |
| children | No | Generic blocks for create mode A. E.g. [{block_type:2, text:{elements:[{text_run:{content:"Hello"}}]}}] | |
| image_path | No | Local image path — create mode B (mutually exclusive with other create modes). | |
| image_token | No | Pre-uploaded docx image token — create mode C, or update image-replace. | |
| file_path | No | Local file path — create mode D (mutually exclusive with other create modes). | |
| file_token | No | Pre-uploaded docx file token — create mode E, or update file-replace. | |
| update_body | No | Generic update payload for action=update. E.g. {update_text_elements:{elements:[{text_run:{content:"new text"}}]}}. |