logseq_get_all_pages
Retrieve a list of all pages within a Logseq graph, including basic metadata, to enable efficient content management and organization for your knowledge base.
Instructions
List all pages in the graph with basic metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | Repository name (default: current graph) |
Implementation Reference
- src/mcp_server_logseq/server.py:527-537 (handler)Handler implementation in the call_tool method that parses input parameters, calls the Logseq API 'logseq.Editor.getAllPages' with optional repo, and returns formatted list of all pages.elif name == "logseq_get_all_pages": args = GetAllPagesParams(**arguments) result = make_request( "logseq.Editor.getAllPages", [args.repo] if args.repo else [] ) return [TextContent( type="text", text=format_pages_list(result) )]
- Pydantic input schema defining the optional 'repo' parameter for the tool.class GetAllPagesParams(LogseqBaseModel): """Parameters for listing all pages""" repo: Annotated[ Optional[str], Field( default=None, description="Repository name (default: current graph)" ) ]
- src/mcp_server_logseq/server.py:248-252 (registration)Tool registration in the list_tools() method, defining name, description, and linking to the input schema.Tool( name="logseq_get_all_pages", description="List all pages in the graph with basic metadata", inputSchema=GetAllPagesParams.model_json_schema(), ),
- Helper function that formats the API response (list of pages) into a newline-separated string of page names and UUIDs.def format_pages_list(pages: list) -> str: """Format list of pages""" return "\n".join( f"{p['name']} (UUID: {p.get('uuid')})" for p in sorted(pages, key=lambda x: x.get('name', '')) )
- src/mcp_server_logseq/server.py:341-351 (registration)Prompt registration in list_prompts() defining arguments for prompt-based invocation.Prompt( name="logseq_get_all_pages", description="List all pages in the graph", arguments=[ PromptArgument( name="repo", description="Repository name (optional)", required=False ) ] ),