Skip to main content
Glama

update_block

Modify and enhance Logseq graph blocks by updating content, adding links with [[Page Name]], and optionally adjusting properties using block ID and new data.

Instructions

Updates an existing block in the Logseq graph.

Use [[Page Name]] to create links to other pages.

Args:
    block_id: The ID of the block to update.
    content: The new content for the block.
    properties: Optional properties to update on the block.
    
Returns:
    Information about the updated block.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
block_idYes
contentYes
propertiesNo

Implementation Reference

  • The MCP tool handler for 'update_block'. Decorated with @mcp.tool(), it defines the input schema via type hints and docstring, and delegates the logic to the LogseqAPIClient.
    @mcp.tool()
    def update_block(block_id: str, content: str, properties: Optional[Dict] = None) -> Dict:
        """
        Updates an existing block in the Logseq graph.
        
        Use [[Page Name]] to create links to other pages.
        
        Args:
            block_id: The ID of the block to update.
            content: The new content for the block.
            properties: Optional properties to update on the block.
            
        Returns:
            Information about the updated block.
        """
        return logseq_client.update_block(block_id, content, properties)
  • Core implementation logic in LogseqAPIClient that prepares parameters and calls the Logseq API endpoint 'logseq.Editor.updateBlock'.
    def update_block(self, block_id: str, content: str, properties: Optional[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
  • Exported as part of the tools module __all__ list, making it available for import.
    "update_block",
  • Imported and re-exported in the package __init__.py __all__.
    update_block,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While it states this is an update operation and mentions link creation syntax, it doesn't describe important behavioral aspects like permission requirements, whether the update overwrites or merges content, error conditions, or what 'Information about the updated block' actually contains. Significant gaps remain for a mutation tool.

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?

The description is well-structured with clear sections (purpose, usage tip, args, returns) and reasonably concise. The 'Use [[Page Name]]...' tip is helpful but could be more integrated. Overall efficient with minimal waste.

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 description coverage, and no output schema, the description provides basic parameter semantics and return indication but lacks details on behavioral aspects, error handling, and the actual return format. It's minimally adequate but has clear gaps given the complexity.

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?

The description provides clear parameter explanations beyond the schema (which has 0% description coverage): it defines block_id as 'The ID of the block to update', content as 'The new content for the block', and properties as 'Optional properties to update on the block'. This adds substantial value over the bare schema, though it could elaborate on properties format.

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

Purpose4/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 'existing block in the Logseq graph', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'insert_block' or 'move_block' beyond the basic operation name.

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

Usage Guidelines3/5

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

The description provides some implied usage context by mentioning 'Use [[Page Name]] to create links to other pages' and listing parameters, but doesn't explicitly state when to use this tool versus alternatives like 'insert_block' or 'move_block'. No clear when-not-to-use guidance or prerequisites are provided.

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

Related 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/apw124/logseq-mcp'

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