Skip to main content
Glama
dailydaniel

Logseq MCP Server

logseq_create_page

Create new Logseq pages with customizable properties, tags, and formats. Automate journal page creation with date formatting and initial blocks for efficient knowledge management.

Instructions

Create a new page in Logseq with optional properties. Features: - Journal page creation with date formatting - Custom page properties (tags, status, etc.) - Format selection (Markdown/Org-mode) - Automatic first block creation Perfect for template-based page creation and knowledge management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
create_first_blockNoCreate initial block
formatNoPage formatmarkdown
journalNoJournal page flag
page_nameYesName of the page to create
propertiesNoPage properties

Implementation Reference

  • Handler function that executes the logseq_create_page tool: parses CreatePageParams, calls Logseq API 'logseq.Editor.createPage', formats result with format_page_result.
    elif name == "logseq_create_page":
        args = CreatePageParams(**arguments)
        result = make_request(
            "logseq.Editor.createPage",
            [
                args.page_name,
                args.properties or {},
                {
                    "journal": args.journal,
                    "format": args.format,
                    "createFirstBlock": args.create_first_block
                }
            ]
        )
        return [TextContent(
            type="text",
            text=format_page_result(result)
        )]
  • Pydantic schema/model for input parameters of logseq_create_page tool, including validation for properties.
    class CreatePageParams(LogseqBaseModel):
        """Parameters for creating a new page in Logseq."""
        page_name: Annotated[
            str,
            Field(description="Name of the page to create")
        ]
        properties: Annotated[
            Optional[dict],
            Field(default=None, description="Page properties")
        ]
        journal: Annotated[
            Optional[bool],
            Field(default=False, description="Journal page flag")
        ]
        format: Annotated[
            Optional[str],
            Field(default="markdown", description="Page format")
        ]
        create_first_block: Annotated[
            Optional[bool],
            Field(default=True, description="Create initial block")
        ]
    
        @field_validator('properties', mode='before')
        @classmethod
        def parse_properties(cls, value):
            """Parse properties from JSON string if needed"""
            if isinstance(value, str):
                try:
                    return json.loads(value)
                except json.JSONDecodeError:
                    raise ValueError("Invalid JSON format for properties")
            return value or {}
  • Tool registration in list_tools(): defines name, description, and inputSchema from CreatePageParams.
    Tool(
        name="logseq_create_page",
        description="""Create a new page in Logseq with optional properties.
        Features:
        - Journal page creation with date formatting
        - Custom page properties (tags, status, etc.)
        - Format selection (Markdown/Org-mode)
        - Automatic first block creation
        Perfect for template-based page creation and knowledge management.""",
        inputSchema=CreatePageParams.model_json_schema(),
    ),
  • Prompt registration in list_prompts(): defines arguments for logseq_create_page.
        name="logseq_create_page",
        description="Create a new Logseq page",
        arguments=[
            PromptArgument(
                name="page_name",
                description="Name of the page to create",
                required=True,
            ),
            PromptArgument(
                name="properties",
                description="Optional page properties as JSON",
                required=False,
            ),
            PromptArgument(
                name="journal",
                description="Set true for journal pages",
                required=False,
            ),
        ],
    ),
  • Helper function to format the result of page creation for user-friendly output.
    def format_page_result(result: dict) -> str:
        """Format page creation result into readable text."""
        properties = "".join(
            f"  {key}: {value}\n" for key, value in result.get('propertiesTextValues', {}).items()
        )
        properties_text = "\n" + properties if properties else " None"
    
        return (
            f"Created page: {result.get('name')}\n"
            f"UUID: {result.get('uuid')}\n"
            f"Journal: {result.get('journal', False)}\n"
            f"Properties: {properties_text}"
        )
Behavior3/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 mentions features like journal page creation, custom properties, format selection, and automatic first block creation, which adds useful context beyond basic functionality. However, it doesn't cover critical aspects like error conditions, permission requirements, or what happens on duplicate page names.

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

Conciseness4/5

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

The description is well-structured with a clear opening sentence followed by bullet points highlighting key features. It's appropriately sized and front-loaded with the main purpose. The bullet points could be slightly more concise, but overall it's efficient with minimal waste.

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

Completeness3/5

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

For a creation tool with 5 parameters, no annotations, and no output schema, the description provides adequate coverage of what the tool does and some behavioral context. However, it lacks information about return values, error handling, and more detailed usage scenarios that would be helpful given the tool's complexity and mutation nature.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds some semantic context by mentioning 'journal page creation with date formatting' (relating to the journal parameter) and 'custom page properties (tags, status, etc.)' (relating to properties parameter), but doesn't provide additional syntax or format details beyond what the schema provides.

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

Purpose4/5

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

The description clearly states the tool creates a new page in Logseq with optional properties, which is a specific verb+resource combination. However, it doesn't explicitly distinguish this from sibling tools like logseq_insert_block or logseq_get_all_pages, which handle different operations.

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

Usage Guidelines3/5

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

The description mentions 'Perfect for template-based page creation and knowledge management,' which implies usage context but doesn't provide explicit guidance on when to use this tool versus alternatives like logseq_edit_block or logseq_insert_block. No when-not-to-use scenarios or prerequisites are mentioned.

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

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

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