logseq_get_current_page
Retrieve the currently active page or block in your Logseq workspace using this tool, enabling streamlined interaction with your knowledge graph without requiring input parameters.
Instructions
Retrieves the currently active page or block in the user's workspace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp_server_logseq/server.py:502-512 (handler)Main handler function in call_tool that executes the tool by calling Logseq API 'logseq.Editor.getCurrentPage' and formatting the result using format_no_arg_result.elif name == "logseq_get_current_page": args = GetCurrentPageParams(**arguments) result = make_request( "logseq.Editor.getCurrentPage", [] ) return [TextContent( type="text", text=format_no_arg_result(name, result) )]
- Pydantic model defining the input schema for the tool (empty params).class GetCurrentPageParams(LogseqBaseModel): """Parameters for getting current page (no arguments needed)"""
- src/mcp_server_logseq/server.py:238-242 (registration)Tool registration in the list_tools() function, defining name, description, and input schema.Tool( name="logseq_get_current_page", description="Retrieves the currently active page or block in the user's workspace", inputSchema=GetCurrentPageParams.model_json_schema(), ),
- Helper lambda in format_no_arg_result that formats the output of logseq_get_current_page.'logseq_get_current_page': lambda r: ( f"Current: {r.get('name', r.get('content', 'Untitled'))}\n" f"UUID: {r.get('uuid')}\n" f"Last updated: {r.get('updatedAt', 'N/A')}" ),