Skip to main content
Glama
mikeysrecipes

Logseq MCP Tools

create_block

Add bullet-point content to Logseq pages. Specify page name and content, optionally include properties. Automatically formats as bullet points and supports page links with [[Page Name]] syntax.

Instructions

Creates a new block on a page in the Logseq graph.

IMPORTANT NOTES:
1. All blocks are automatically formatted as bullet points in Logseq UI
2. To create links to other pages, use double brackets: [[Page Name]]

When creating blocks on journal pages:
  - The block will inherit the "journal?" and "journalDay" attributes from the page
  - "journalDay" will be in YYYYMMDD format (e.g., 20250404 for April 4, 2025)

Args:
    page_name (str): The name of the page to create the block on.
    content (str): The content of the new block.
    properties (dict, optional): Properties to set on the new block.
    
Returns:
    dict: Information about the created block.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_nameYes
contentYes
propertiesNo

Implementation Reference

  • The MCP tool handler for 'create_block', decorated with @mcp.tool(). Defines input schema via type hints and docstring. Delegates to LogseqAPIClient.create_block.
    @mcp.tool()
    def create_block(page_name: str, content: str, properties: Optional[Dict] = None) -> Dict:
        """
        Creates a new block on a page in the Logseq graph.
        
        IMPORTANT NOTES:
        1. All blocks are automatically formatted as bullet points in Logseq UI
        2. To create links to other pages, use double brackets: [[Page Name]]
        
        When creating blocks on journal pages:
          - The block will inherit the "journal?" and "journalDay" attributes from the page
          - "journalDay" will be in YYYYMMDD format (e.g., 20250404 for April 4, 2025)
        
        Args:
            page_name (str): The name of the page to create the block on.
            content (str): The content of the new block.
            properties (dict, optional): Properties to set on the new block.
            
        Returns:
            dict: Information about the created block.
        """
        """Create a new block on the specified page."""
        return logseq_client.create_block(page_name, content, properties)
  • Supporting utility in LogseqAPIClient that makes the actual API call to Logseq to append a new block to a page.
    def create_block(self, page_name: str, content: str, properties: Dict = None) -> Dict:
        """Create a new block on a page"""
        params = [page_name, content]
        if properties:
            params.append(properties)
        response = self.call_api("logseq.Editor.appendBlockInPage", params)
        if isinstance(response, dict) and "result" in response:
            return response.get("result")
        return response
  • Re-exports the create_block tool from blocks.py for convenient import in other modules.
    from .blocks import get_page_blocks, get_block, create_block, update_block, remove_block, insert_block, move_block, search_blocks
  • Includes create_block in the public __all__ exports of the package.
    create_block, 
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 of behavioral disclosure. It effectively describes key behaviors: automatic bullet-point formatting, link syntax requirements, inheritance of journal attributes, and format specifics for journalDay. It doesn't cover error conditions, permissions, or rate limits, but provides substantial operational context beyond basic functionality.

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 well-structured with clear sections: purpose statement, important notes with formatting rules, journal-specific behavior, and parameter explanations. Every sentence adds value, with no redundant information. The front-loaded purpose statement immediately communicates the tool's function.

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?

For a mutation tool with no annotations and no output schema, the description provides substantial context about behavior, parameters, and Logseq-specific conventions. It covers the core functionality comprehensively but doesn't describe the return value structure (only mentions it returns 'information about the created block') or error conditions, which would be helpful given the lack of output schema.

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?

With 0% schema description coverage, the description must compensate fully. It provides clear semantic explanations for all three parameters: page_name identifies the target page, content specifies the block text, and properties defines optional metadata. The description adds meaningful context about how these parameters interact with Logseq's behavior, though it could elaborate on properties format.

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 action ('Creates a new block'), the resource ('on a page in the Logseq graph'), and distinguishes it from siblings like create_page (creates pages, not blocks) and insert_block (inserts blocks at specific positions). The verb+resource combination is specific and unambiguous.

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 about when to use this tool (creating blocks on pages, with formatting notes for links and journal pages). However, it doesn't explicitly state when NOT to use it or name alternatives like insert_block for positioning blocks at specific locations, which would be helpful for sibling differentiation.

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