get_page
Retrieve a specific page from a Logseq graph by name, including journal pages formatted as "mmm dth, yyyy". Returns page details or None if not found.
Instructions
Gets a specific page from the Logseq graph by name.
For journal pages, use the format "mmm dth, yyyy" (e.g., "Apr 4th, 2025").
Journal pages have specific attributes:
- "journal?": true - Indicates this is a journal page
- "journalDay": YYYYMMDD - The date in numeric format
Args:
name: The name of the page to retrieve.
Returns:
Information about the requested page, or None if not found.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- src/logseq_mcp/tools/pages.py:21-37 (handler)The MCP tool handler for the 'get_page' tool. Decorated with @mcp.tool(), it defines the input (name: str) and output (Optional[Dict]) schema via type hints and docstring, and implements the logic by delegating to the Logseq client.@mcp.tool() def get_page(name: str) -> Optional[Dict]: """ Gets a specific page from the Logseq graph by name. For journal pages, use the format "mmm dth, yyyy" (e.g., "Apr 4th, 2025"). Journal pages have specific attributes: - "journal?": true - Indicates this is a journal page - "journalDay": YYYYMMDD - The date in numeric format Args: name: The name of the page to retrieve. Returns: Information about the requested page, or None if not found. """ return logseq_client.get_page(name)
- Helper method in LogseqAPIClient that performs the actual API call to retrieve the page from Logseq.def get_page(self, page_name: str) -> Optional[Dict]: """Get a page by name""" response = self.call_api("logseq.Editor.getPage", [page_name]) if response is None: return None return response.get("result") if isinstance(response, dict) else response
- src/logseq_mcp/__init__.py:5-6 (registration)Exported in the package __init__.py for easy import of the tool function.get_page, create_page,
- src/logseq_mcp/tools/__init__.py:1-6 (registration)Imported and re-exported in tools/__init__.py.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",