Skip to main content
Glama
mikeysrecipes

Logseq MCP Tools

move_block

Move a block and its children to reorganize your Logseq knowledge graph, either as a child or sibling of another block.

Instructions

Moves a block to a new location in the graph.

This allows for reorganizing the structure of blocks in the graph by moving
a block (and all its children) to a different location.

IMPORTANT NOTES:
1. The block will maintain its children when moved
2. The hierarchical position depends on the 'as_child' parameter:
   - If as_child=True: The block becomes a child of the target block
   - If as_child=False: The block becomes a sibling after the target block

Args:
    block_id (str): The ID of the block to move.
    target_block_id (str): The ID of the target block to move to.
    as_child (bool, optional): Whether to make the block a child of the target.
                              Default is False (insert as sibling).
    
Returns:
    dict: Result of the move operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
block_idYes
target_block_idYes
as_childNo

Implementation Reference

  • MCP tool handler for 'move_block': decorated with @mcp.tool(), defines input schema via type hints and docstring, executes by calling logseq_client.move_block
    @mcp.tool()
    def move_block(block_id: str, target_block_id: str, as_child: bool = False) -> Dict:
        """
        Moves a block to a new location in the graph.
        
        This allows for reorganizing the structure of blocks in the graph by moving
        a block (and all its children) to a different location.
        
        IMPORTANT NOTES:
        1. The block will maintain its children when moved
        2. The hierarchical position depends on the 'as_child' parameter:
           - If as_child=True: The block becomes a child of the target block
           - If as_child=False: The block becomes a sibling after the target block
        
        Args:
            block_id (str): The ID of the block to move.
            target_block_id (str): The ID of the target block to move to.
            as_child (bool, optional): Whether to make the block a child of the target.
                                      Default is False (insert as sibling).
            
        Returns:
            dict: Result of the move operation.
        """
        """Move a block to a new location in the graph."""
        return logseq_client.move_block(block_id, target_block_id, as_child)
  • Helper method in LogseqAPIClient that performs the actual Logseq API call for moving a block using logseq.Editor.moveBlock with structured parameters.
    def move_block(self, block_id: str, target_block_id: str, as_child: bool = False) -> Dict:
        """Move a block to a new location in the graph"""
        # Determine the appropriate API method based on the as_child parameter
        method = "logseq.Editor.moveBlock"
        
        # The API expects a structured argument for the move operation
        move_params = {
            "srcUUID": block_id,
            "targetUUID": target_block_id,
            "isChild": as_child
        }
        
        response = self.call_api(method, [move_params])
        if isinstance(response, dict) and "result" in response:
            return response.get("result")
        return response
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: the block maintains its children when moved, and the hierarchical outcome depends on the 'as_child' parameter (child vs. sibling placement). However, it does not cover aspects like permissions needed, error conditions, or rate limits, leaving some gaps in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with a clear purpose statement, followed by elaboration, important notes, and structured parameter details. Every sentence adds value without redundancy, such as explaining hierarchical dependencies and parameter defaults, making it efficient and well-organized for agent comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no annotations, no output schema), the description is largely complete. It covers purpose, behavioral traits, and parameter semantics effectively. However, it lacks details on the return value (only states 'dict: Result of the move operation' without specifics) and does not address potential errors or side effects, leaving minor gaps in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate fully. It adds significant meaning beyond the bare schema by explaining each parameter: block_id as 'the ID of the block to move', target_block_id as 'the ID of the target block to move to', and as_child with detailed semantics on child vs. sibling placement and default behavior. This provides clear context that the schema alone lacks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Moves a block to a new location') and resource ('in the graph'), distinguishing it from siblings like create_block, insert_block, or remove_block by focusing on relocation rather than creation, insertion, or deletion. The second sentence elaborates on the purpose of reorganizing block structure, reinforcing the distinct functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for reorganizing block structure but does not explicitly state when to use this tool versus alternatives like insert_block or update_block. It provides context about moving blocks with children, which hints at usage scenarios, but lacks clear guidance on prerequisites, exclusions, or named alternatives for different use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/mikeysrecipes/logseq-mcp'

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