append_block
Appends a block as the last child of a specified parent block, ensuring stable hierarchy. Ideal for adding lists or content under a heading without affecting sibling order.
Instructions
插入后置子块。
适用场景: - 需要稳定地追加到某个父块末尾(强父子关系)。 - 例如把有序/无序列表追加到某个 H2/H3 下。
使用方法: - parent_id 传入目标父块 ID。 - data 为待插入内容,data_type 支持 markdown 或 dom。
注意事项: - 该工具不会使用 next_id/previous_id 锚点,适合避免层级歧义。 - 若需要插入到父块子节点中间位置,请使用 insert_block 并结合锚点。
与 insert_block 的区别: - append_block 强制作为父块的最后一个子块,层级关系稳定。 - insert_block 依赖相邻块定位,层级可能因 next_id/previous_id 而变化。
示例(假设现有结构:父块A -> 子块B -> 子块C): # 插入到 A 的末尾(作为最后一个子块) append_block(parent_id="block_a", data="新块") # 结果:A -> B -> C -> 新块
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| data_type | No | markdown | |
| parent_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |