Skip to main content
Glama
mikeysrecipes

Logseq MCP Tools

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
NameRequiredDescriptionDefault
nameYes

Implementation Reference

  • 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
  • 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",
    ] 
Behavior4/5

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

With no annotations provided, the description carries the full burden and does so effectively. It discloses critical behavioral traits: the operation is destructive ('removes the specified page and all its blocks'), irreversible ('cannot be undone'), and includes a special case for journal pages. This covers key aspects like destructiveness and constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the purpose, followed by behavioral details, usage guidelines, and parameter explanations. Every sentence adds value with no wasted words, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive operation with 1 parameter) and no annotations or output schema, the description is largely complete. It covers purpose, behavior, usage, and parameters. A minor gap is the lack of detail on the return value ('dict: Result of the deletion operation') which is vague, but overall it provides sufficient context for safe use.

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 schema has 0% description coverage, so the description must compensate. It adds meaningful semantics by explaining that the 'name' parameter is 'the name of the page to delete' and provides a specific format example for journal pages ('mmm dth, yyyy'), which clarifies usage beyond the bare schema. This is strong compensation for the low coverage.

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

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('deletes'), the resource ('a page from the Logseq graph'), and distinguishes it from siblings like 'remove_block' or 'delete_page' by specifying it removes the page and all its blocks. This provides precise differentiation.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (to delete pages) and includes a specific guideline for journal pages with a format example. However, it does not explicitly mention when not to use it or name alternatives like 'remove_block' for partial deletions, which would have earned a 5.

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

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

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