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
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses important behavioral traits: automatic bullet formatting, link syntax using double brackets, and preservation of journal attributes. However, it doesn't mention permissions needed, error conditions, or whether the update is reversible/destructive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with purpose statement, important notes section, and parameter/return documentation. Every sentence adds value, though the journal-specific section could be slightly more integrated. Front-loading the core purpose is effective.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 3 parameters, 0% schema coverage, and no output schema, the description does reasonably well by explaining parameters and some behaviors. However, it lacks details on return value structure, error handling, and complete behavioral context, leaving gaps for the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides meaningful explanations for all 3 parameters: block_id identifies the target, content is the new text, and properties are optional metadata. This adds significant value beyond the bare schema, though format details for properties could be more specific.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Updates') and resource ('an existing block in the Logseq graph'), distinguishing it from siblings like create_block (creates new) or remove_block (deletes). It specifies it's for existing blocks only, not creation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (updating existing blocks) and implies alternatives through sibling tool names (e.g., create_block for new blocks, get_block for reading). However, it doesn't explicitly state when NOT to use it or compare directly to alternatives like insert_block.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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