update_block
Modify existing content and properties of a block in your Logseq knowledge graph. Use this tool to edit text, update links with [[Page Name]] syntax, and change block attributes.
Instructions
Updates an existing block in the Logseq graph.
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]]
When updating blocks on journal pages:
- The "journal?" and "journalDay" attributes will be preserved
- "journalDay" will remain in YYYYMMDD format (e.g., 20250404)
Args:
block_id (str): The ID of the block to update.
content (str): The new content for the block.
properties (dict, optional): Properties to update on the block.
Returns:
dict: Information about the updated block.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| block_id | Yes | ||
| content | Yes | ||
| properties | No |
Implementation Reference
- src/logseq_mcp/tools/blocks.py:109-131 (handler)MCP tool handler for update_block. The @mcp.tool() decorator registers the tool and uses the function signature/docstring for schema generation. Delegates to client.@mcp.tool() def update_block(block_id: str, content: str, properties: Optional[Dict] = None) -> Dict: """ Updates an existing block in the Logseq graph. 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]] When updating blocks on journal pages: - The "journal?" and "journalDay" attributes will be preserved - "journalDay" will remain in YYYYMMDD format (e.g., 20250404) Args: block_id (str): The ID of the block to update. content (str): The new content for the block. properties (dict, optional): Properties to update on the block. Returns: dict: Information about the updated block. """ """Update an existing block with new content and properties.""" return logseq_client.update_block(block_id, content, properties)
- Low-level LogseqAPIClient method that calls the Logseq API endpoint logseq.Editor.updateBlock to perform the update.def update_block(self, block_id: str, content: str, properties: Dict = None) -> Dict: """Update an existing block""" params = [block_id, content] if properties: params.append(properties) response = self.call_api("logseq.Editor.updateBlock", params) if isinstance(response, dict) and "result" in response: return response.get("result") return response