delete_node
Delete a single node and its entire subtree from a mindmap, including cleanup of links pointing to deleted nodes. The root node cannot be deleted.
Instructions
Delete a single node and its entire subtree from a mindmap.
This is the SAFE way to delete a node. It reads the full mindmap, removes the target node and all its descendants, cleans free_links pointing to deleted nodes, and syncs the remaining nodes back.
The root node (parent=0) cannot be deleted — returns an error.
The algorithm mirrors the Flutter client's MindMapManager._deleteNodeRecursive:
Recursively collect all descendant order_indexes
Clean free_links in remaining nodes that point to deleted nodes
Remove all deleted nodes in one pass
Sync the remaining nodes back
Args: id_mindmap: Mindmap ID order_index: Order index of the node to delete (1-based)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id_mindmap | Yes | ||
| order_index | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |