insert_block
Insert a new block as a child under a specified parent block in Logseq to organize hierarchical content. Set properties, control placement (beginning or end), and inherit journal attributes when applicable.
Instructions
Inserts a new block as a child of the specified parent block.
This allows for creating hierarchical content by adding children to existing blocks.
IMPORTANT NOTES:
1. All blocks are automatically formatted as bullet points in Logseq UI
2. To create links to other pages, use double brackets: [[Page Name]]
3. The new block will be inserted at the beginning or end of the parent's children
depending on the 'before' parameter
When inserting blocks into journal pages:
- The block will inherit the "journal?" and "journalDay" attributes
- "journalDay" will be in YYYYMMDD format (e.g., 20250404 for April 4, 2025)
Args:
parent_block_id (str): The ID of the parent block to insert under.
content (str): The content of the new block.
properties (dict, optional): Properties to set on the new block.
before (bool, optional): Whether to insert at the beginning of children.
Default is False (append at the end).
Returns:
dict: Information about the created block.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
before | No | ||
content | Yes | ||
parent_block_id | Yes | ||
properties | No |
Input Schema (JSON Schema)
{
"properties": {
"before": {
"default": false,
"title": "Before",
"type": "boolean"
},
"content": {
"title": "Content",
"type": "string"
},
"parent_block_id": {
"title": "Parent Block Id",
"type": "string"
},
"properties": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Properties"
}
},
"required": [
"parent_block_id",
"content"
],
"title": "insert_blockArguments",
"type": "object"
}