Skip to content

Feature: Include block UUIDs and page names in query/search results #43

@Trinition

Description

@Trinition

Problem

When building integrations that need to link back into LogSeq (e.g., a TODO dashboard with logseq:// deep links), the query and search tools don't return enough metadata to construct those links efficiently.

  • query returns block content but no block UUIDs or page names. To get a UUID for deep linking (logseq://graph/<name>?block-id=<uuid>), you'd need to call get_page_content (with JSON format) for every page, then correlate text — an N+1 problem.
  • search returns matching text but similarly lacks block UUIDs and the page name each result belongs to.

Use case

I'm building a live TODO dashboard that aggregates tasks from LogSeq using the MCP tools. It uses query with task filters and between date ranges to bucket tasks by timeline. I'd like each task to be a clickable deep link back into LogSeq using the logseq:// URI scheme, which requires either a block UUID or a page name — neither of which is currently in query/search results without expensive follow-up calls.

Proposed enhancement

Include block UUID and page name in query and search responses. This could be always-on, gated behind include_metadata=true, or included in JSON format only (similar to how get_page_content with format=json already returns UUIDs).

Context

  • Issue Add get_block and get_blocks_by_tag tools #25 addressed a related gap by adding get_block. This goes one step further: including UUIDs directly in output to avoid the round-trip.
  • LogSeq's logseq.DB.q (Datalog) can return UUIDs, but the MCP query tool only supports DSL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions