Skip to main content
Glama

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
NameRequiredDescriptionDefault
repoNoRepository name (default: current graph)

Implementation Reference

  • 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)" ) ]
  • 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', '')) )
  • 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 ) ] ),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dailydaniel/logseq-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server