get_all_pages
Retrieve all pages from a Logseq graph, including journal pages identified by the 'journal?' attribute and 'journalDay' in YYYYMMDD format, for comprehensive graph management.
Instructions
Gets all pages from the Logseq graph.
Journal pages can be identified by the "journal?" attribute set to true and
will include a "journalDay" attribute in the format YYYYMMDD.
Returns:
List of all pages in the Logseq graph.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/logseq_mcp/tools/pages.py:8-19 (handler)The MCP tool handler for 'get_all_pages', decorated with @mcp.tool(). It has no input parameters and returns a list of page dictionaries. Includes documentation on journal pages. Delegates execution to the LogseqAPIClient instance.@mcp.tool() def get_all_pages() -> List[Dict]: """ Gets all pages from the Logseq graph. Journal pages can be identified by the "journal?" attribute set to true and will include a "journalDay" attribute in the format YYYYMMDD. Returns: List of all pages in the Logseq graph. """ return logseq_client.get_all_pages()
- Supporting helper method in LogseqAPIClient that calls the Logseq API endpoint 'logseq.Editor.getAllPages', handles the response format, and ensures a list of pages is returned.def get_all_pages(self) -> List[Dict]: """Get all pages in the graph""" response = self.call_api("logseq.Editor.getAllPages") if isinstance(response, list): return response return response.get("result", []) if isinstance(response, dict) else []
- src/logseq_mcp/tools/__init__.py:1-5 (registration)Import and exposure of the get_all_pages tool function in the tools package __init__ for registration and usage.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",
- src/logseq_mcp/tools/pages.py:9-19 (schema)Type signature and documentation defining the tool's no-input schema and output as List[Dict] with details on journal page structure.def get_all_pages() -> List[Dict]: """ Gets all pages from the Logseq graph. Journal pages can be identified by the "journal?" attribute set to true and will include a "journalDay" attribute in the format YYYYMMDD. Returns: List of all pages in the Logseq graph. """ return logseq_client.get_all_pages()