create_page
Generate new pages in Logseq with customizable properties and automatic journal configuration. Simplify graph organization and entry management using direct input options.
Instructions
Creates a new page in the Logseq graph.
For journal pages, use the format "mmm dth, yyyy" (e.g., "Apr 4th, 2025").
Logseq automatically sets "journal?": true and "journalDay": YYYYMMDD.
Args:
name: The name of the new page.
properties: Optional properties to set on the new page.
Returns:
Information about the created page.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| properties | No |
Implementation Reference
- src/logseq_mcp/tools/pages.py:39-54 (handler)The primary MCP tool handler for 'create_page', decorated with @mcp.tool(). Delegates to LogseqAPIClient.create_page().@mcp.tool() def create_page(name: str, properties: Optional[Dict] = None) -> Dict: """ Creates a new page in the Logseq graph. For journal pages, use the format "mmm dth, yyyy" (e.g., "Apr 4th, 2025"). Logseq automatically sets "journal?": true and "journalDay": YYYYMMDD. Args: name: The name of the new page. properties: Optional properties to set on the new page. Returns: Information about the created page. """ return logseq_client.create_page(name, properties)
- Underlying helper method in LogseqAPIClient that calls the Logseq API endpoint 'logseq.Editor.createPage'.def create_page(self, page_name: str, properties: Optional[Dict] = None) -> Dict: """Create a new page""" params = [page_name] if properties: params.append(properties) response = self.call_api("logseq.Editor.createPage", params) if isinstance(response, dict) and "result" in response: return response.get("result") return response
- src/logseq_mcp/tools/__init__.py:1-7 (registration)Re-exports the create_page tool function for use in other modules, facilitating its availability for MCP registration.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",
- src/logseq_mcp/__init__.py:3-13 (registration)Imports and exports the create_page tool as part of the package __all__, making it available when the package is imported before running the MCP server.from .tools import ( get_all_pages, get_page, create_page, get_page_blocks, get_block, create_block, update_block, search_blocks, get_page_linked_references, )