Skip to main content
Glama

update_block

Modify existing blocks in Logseq by updating content or properties, ensuring journal page attributes are preserved. Use block ID and new content to streamline knowledge graph adjustments.

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
NameRequiredDescriptionDefault
block_idYes
contentYes
propertiesNo

Implementation Reference

  • The primary MCP tool handler for 'update_block', including type hints, docstring schema, @mcp.tool() decorator for registration, and logic delegating to the 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)
  • Helper method in LogseqAPIClient that makes the actual HTTP API call to Logseq's updateBlock endpoint.
    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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mikeysrecipes/logseq-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server