Skip to main content
Glama
mikeysrecipes

Logseq MCP Tools

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

Implementation Reference

  • 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

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