get_page_linked_references
Find all blocks that link to a specific Logseq page using [[Page Name]] notation. Returns references to help track connections in your knowledge graph.
Instructions
Gets all linked references to a specific page in the Logseq graph.
This returns blocks that contain links to the specified page using
the Logseq double bracket notation: [[Page Name]].
For journal pages, use the format "mmm dth, yyyy" (e.g., "Apr 4th, 2025").
Args:
page_name (str): The name of the page to find references to.
Returns:
list: A list of blocks that reference the specified page.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_name | Yes |
Implementation Reference
- src/logseq_mcp/tools/pages.py:84-101 (handler)The MCP tool handler for 'get_page_linked_references'. Decorated with @mcp.tool(), it defines the tool's input (page_name: str) and output (List[Dict]), with a detailed docstring for schema. Delegates to LogseqAPIClient for execution.@mcp.tool() def get_page_linked_references(page_name: str) -> List[Dict]: """ Gets all linked references to a specific page in the Logseq graph. This returns blocks that contain links to the specified page using the Logseq double bracket notation: [[Page Name]]. For journal pages, use the format "mmm dth, yyyy" (e.g., "Apr 4th, 2025"). Args: page_name (str): The name of the page to find references to. Returns: list: A list of blocks that reference the specified page. """ """Get all blocks that link to the specified page.""" return logseq_client.get_page_linked_references(page_name)
- Supporting helper method in LogseqAPIClient that calls the underlying Logseq API endpoint 'logseq.Editor.getPageLinkedReferences' and handles the response format.def get_page_linked_references(self, page_name: str) -> List[Dict]: """Get linked references to a page""" response = self.call_api("logseq.Editor.getPageLinkedReferences", [page_name]) if isinstance(response, list): return response return response.get("result", []) if isinstance(response, dict) else []