Skip to main content
Glama
dailydaniel

Logseq MCP Server

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
            )
        ]
    ),
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'basic metadata' but doesn't specify what that includes (e.g., page names, creation dates) or operational details like pagination, rate limits, or error handling. This leaves significant gaps for a tool that lists all pages.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and resource without any wasted words. It is appropriately sized for a simple list operation, making it easy for an AI agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of listing all pages in a graph, the description is incomplete. With no annotations and no output schema, it fails to explain what 'basic metadata' entails, how results are structured, or potential limitations (e.g., large graphs). This leaves the AI agent with insufficient context for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, clearly documenting the optional 'repo' parameter. The description adds no additional parameter details beyond what the schema provides, such as examples or constraints, so it meets the baseline for high schema coverage without enhancing semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List') and resource ('all pages in the graph') with scope ('basic metadata'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'logseq_get_page' or 'logseq_get_current_page', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'logseq_get_page' (for a single page) or 'logseq_get_current_page' (for the active page). It lacks any context about prerequisites, such as needing an open graph, or exclusions, which limits its utility for an AI agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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