get_all_pages
Retrieve all pages from your Logseq graph, including journal entries with date attributes, to access your complete knowledge base.
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: A 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-20 (handler)The main MCP tool handler for 'get_all_pages', decorated with @mcp.tool(). It calls the LogseqAPIClient's get_all_pages method to retrieve all pages from the Logseq graph.@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: A list of all pages in the Logseq graph. """ """Fetch all pages from Logseq.""" return logseq_client.get_all_pages()
- Supporting method in LogseqAPIClient that handles the actual API call to Logseq's 'logseq.Editor.getAllPages' endpoint and normalizes the response to a list of page dictionaries.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/__init__.py:17-17 (registration)The package __all__ export list includes 'get_all_pages', indicating it's part of the public API. Importing this module registers all tools via their decorators.__all__ = ["get_all_pages", "get_page", "create_page", "get_page_blocks", "get_block", "create_block", "update_block", "search_blocks", "get_page_linked_references"]
- src/logseq_mcp/tools/pages.py:6-6 (helper)Global LogseqAPIClient instance used by the get_all_pages tool and other page-related tools.logseq_client = LogseqAPIClient()