delete_page
Remove pages from your Logseq graph, including all associated blocks, with irreversible deletion for journal pages using date format.
Instructions
Deletes a page from the Logseq graph.
This operation removes the specified page and all its blocks. This action cannot be undone.
For journal pages, use the format "mmm dth, yyyy" (e.g., "Apr 4th, 2025").
Args:
name (str): The name of the page to delete.
Returns:
dict: Result of the deletion operation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- src/logseq_mcp/tools/pages.py:66-82 (handler)The primary MCP tool handler for 'delete_page', decorated with @mcp.tool(). It takes a page name and delegates the deletion to the LogseqAPIClient instance.@mcp.tool() def delete_page(name: str) -> Dict: """ Deletes a page from the Logseq graph. This operation removes the specified page and all its blocks. This action cannot be undone. For journal pages, use the format "mmm dth, yyyy" (e.g., "Apr 4th, 2025"). Args: name (str): The name of the page to delete. Returns: dict: Result of the deletion operation. """ """Delete a page from the Logseq graph.""" return logseq_client.delete_page(name)
- Core helper method in LogseqAPIClient that performs the actual API call to Logseq's 'logseq.Editor.deletePage' endpoint to delete the specified page.def delete_page(self, page_name: str) -> Dict: """Delete a page from the graph""" response = self.call_api("logseq.Editor.deletePage", [page_name]) if isinstance(response, dict) and "result" in response: return response.get("result") return response
- src/logseq_mcp/tools/__init__.py:1-18 (registration)Re-exports the delete_page tool function along with others, facilitating its import and registration via module import since tools are auto-registered by decorators.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", ]