Skip to main content
Glama

remove_block

Permanently delete a block and its child blocks from the Logseq graph. Specify the block ID to complete the operation, which cannot be undone. Ideal for managing and organizing your knowledge base.

Instructions

Removes a block from the Logseq graph. ⚠️ Permanently removes the block and all its children. Cannot be undone. Args: block_id: The ID of the block to remove. Returns: Result of the removal operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
block_idYes

Implementation Reference

  • MCP tool handler for 'remove_block'. Defines the tool with @mcp.tool() decorator, includes schema via type hints and docstring, and delegates to LogseqAPIClient.remove_block().
    @mcp.tool() def remove_block(block_id: str) -> Dict: """ Removes a block from the Logseq graph. ⚠️ Permanently removes the block and all its children. Cannot be undone. Args: block_id: The ID of the block to remove. Returns: Result of the removal operation. """ return logseq_client.remove_block(block_id)
  • Core helper method in LogseqAPIClient that implements the block removal by calling the Logseq API endpoint 'logseq.Editor.removeBlock'.
    def remove_block(self, block_id: str) -> Dict: """Remove a block and its children from the graph""" response = self.call_api("logseq.Editor.removeBlock", [block_id]) if isinstance(response, dict) and "result" in response: return response.get("result") return response
  • Re-exports the remove_block tool from blocks.py, likely facilitating its registration when tools module is imported by the MCP server.
    from .pages import get_all_pages, get_page, create_page, delete_page, get_page_linked_references from .blocks import get_page_blocks, get_block, create_block, update_block, remove_block, insert_block, move_block, search_blocks __all__ = [ "get_all_pages", "get_page", "create_page", "delete_page", "get_page_blocks", "get_block", "create_block", "update_block", "remove_block", "insert_block", "move_block", "search_blocks", "get_page_linked_references", ]

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