delete_page
Remove a specified page and all its blocks from a Logseq graph. This operation is irreversible. Use correct format for journal pages, e.g., "Apr 4th, 2025".
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 MCP tool handler for 'delete_page'. It is decorated with @mcp.tool() which handles registration and schema generation from the docstring and type annotations. The function delegates to the LogseqAPIClient's delete_page method.@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)
- Helper method in LogseqAPIClient class that makes the actual API call to Logseq's 'logseq.Editor.deletePage' endpoint and processes the response.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-1 (registration)Import statement in tools/__init__.py that loads the pages.py module, triggering the execution of the @mcp.tool() decorator for delete_page registration.from .pages import get_all_pages, get_page, create_page, delete_page, get_page_linked_references