get_page_linked_references
Retrieve all blocks containing links to a specific Logseq page. Input the page name to generate a list of references for tracking and organizing interconnected notes.
Instructions
Gets all linked references to a specific page.
Returns blocks containing [[Page Name]] links to the specified page.
Args:
page_name: The name of the page to find references to.
Returns:
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:72-84 (handler)The main MCP tool handler for 'get_page_linked_references', decorated with @mcp.tool(). It defines the input (page_name: str) and output (List[Dict]) schema via typing and docstring, and delegates to LogseqAPIClient.def get_page_linked_references(page_name: str) -> List[Dict]: """ Gets all linked references to a specific page. Returns blocks containing [[Page Name]] links to the specified page. Args: page_name: The name of the page to find references to. Returns: List of blocks that reference the specified page. """ return logseq_client.get_page_linked_references(page_name)
- Supporting method in LogseqAPIClient that performs the actual API call to Logseq's getPageLinkedReferences endpoint.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 []
- src/logseq_mcp/tools/__init__.py:4-17 (registration)Re-export of the tool function in tools/__init__.py for convenient import.__all__ = [ "get_all_pages", "get_page", "create_page", "delete_page", "get_page_blocks", "get_block", "create_block", "update_block", "remove_block", "insert_block", "move_block", "search_blocks", "get_page_linked_references",
- src/logseq_mcp/__init__.py:17-17 (registration)Re-export of the tool function in the main package __init__.py.__all__ = ["get_all_pages", "get_page", "create_page", "get_page_blocks", "get_block", "create_block", "update_block", "search_blocks", "get_page_linked_references"]