Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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)"""
  • 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')}" ),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dailydaniel/logseq-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server