logseq_get_page
Retrieve metadata and content of a specific Logseq page by its identifier, with optional inclusion of child blocks, enabling detailed knowledge graph interaction.
Instructions
Retrieve detailed information about a specific page including metadata and content
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_children | No | Include child blocks in response | |
| src_page | Yes | Page identifier (name, UUID or database ID) |
Implementation Reference
- src/mcp_server_logseq/server.py:513-525 (handler)Handler implementation for the logseq_get_page tool: validates input with GetPageParams, calls Logseq API 'logseq.Editor.getPage' with src_page and includeChildren option, formats and returns the page result.elif name == "logseq_get_page": args = GetPageParams(**arguments) result = make_request( "logseq.Editor.getPage", [ args.src_page, {"includeChildren": args.include_children} ] ) return [TextContent( type="text", text=format_page_result(result) )]
- Pydantic schema/model for logseq_get_page tool inputs: src_page (page identifier as str or int), include_children (optional bool).class GetPageParams(LogseqBaseModel): """Parameters for retrieving a specific page""" src_page: Annotated[ str | int, Field( description="Page identifier (name, UUID or database ID)", examples=["[[Journal/2024-03-15]]", 12345] ) ] include_children: Annotated[ Optional[bool], Field( default=False, description="Include child blocks in response" ) ]
- src/mcp_server_logseq/server.py:243-247 (registration)Tool registration in MCP server's list_tools(): defines name, description, and input schema for logseq_get_page.Tool( name="logseq_get_page", description="Retrieve detailed information about a specific page including metadata and content", inputSchema=GetPageParams.model_json_schema(), ),
- src/mcp_server_logseq/server.py:330-340 (registration)Prompt registration in MCP server's list_prompts(): defines prompt for logseq_get_page with src_page argument.Prompt( name="logseq_get_page", description="Retrieve information about a specific page", arguments=[ PromptArgument( name="src_page", description="Page name, UUID or database ID", required=True ) ] ),
- Helper function to format the page result from API into readable text output, used by logseq_get_page handler.def format_page_result(result: dict) -> str: """Format page creation result into readable text.""" properties = "".join( f" {key}: {value}\n" for key, value in result.get('propertiesTextValues', {}).items() ) properties_text = "\n" + properties if properties else " None" return ( f"Created page: {result.get('name')}\n" f"UUID: {result.get('uuid')}\n" f"Journal: {result.get('journal', False)}\n" f"Properties: {properties_text}" )