block
This tool covers block insertion, updates, movement, metadata, references, and document-context helpers.
When to read this page: you need to manipulate block content directly instead of working at the whole-document level.
Related pages:
Common Actions
| Group | Actions |
|---|---|
| Insert and update | insert, prepend, append, update |
| Movement and structure | move, set_fold_state, get_children, breadcrumb |
| Metadata | set_attrs, get_attrs, info, dom, get_kramdown |
| Reference / utility | transfer_references, word_count, recent_updated |
| Daily note helper | add_to_daily_note |
| Document context | docs_info |
Parameters and Semantics
dataTypeis usuallymarkdownordom.prependandappendwork on either a document or a block child list.updateis best for single-block replacement.moverequires at least one destination hint such asparentIDorpreviousID.add_to_daily_noteappends or prepends content to today's daily note viaposition.
Safety Rules
deleteandmoverequire explicit confirmation.- For multiline content, prefer
append,prepend, orinsertinstead ofupdate.
Examples
MCP:
json
{
"action": "append",
"parentID": "<doc-id>",
"dataType": "markdown",
"data": "- [ ] Todo item"
}CLI:
bash
siyuan block append --parent-id <doc-id> --data-type markdown --data "- [ ] Todo item"Action List
insertprependappendupdatedeletemoveset_fold_stateget_kramdownget_childrentransfer_referencesset_attrsget_attrsinfobreadcrumbdomrecent_updatedword_countadd_to_daily_notedocs_info