get_all_pages
Retrieve all pages from a Logseq graph, including journal pages identified by the 'journal?' attribute and YYYYMMDD format. Useful for accessing and managing knowledge graph content.
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)MCP tool handler for 'get_all_pages'. Decorated with @mcp.tool(), it fetches all pages by delegating to LogseqAPIClient.get_all_pages(). Includes type hints and documentation serving as schema.@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()
- Core implementation in LogseqAPIClient that calls the Logseq API 'logseq.Editor.getAllPages', handles response unwrapping, and returns list of pages.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)Imports and exposes 'get_all_pages' in tools package __all__, ensuring it's available for registration when the package is imported.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/__init__.py:3-4 (registration)Imports 'get_all_pages' from tools into the main package, listed in __all__, making it discoverable for MCP server.from .tools import ( get_all_pages,