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,

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