Skip to main content
Glama

move_block

Move a block and its children to a new location in Logseq. Choose to place it as a child or sibling of the target block using block and target IDs for precise organization.

Instructions

Moves a block to a new location in the graph.

Moves a block and all its children to a different location.
- as_child=True: Block becomes a child of the target
- as_child=False: Block becomes a sibling after the target

Args:
    block_id: The ID of the block to move.
    target_block_id: The ID of the target block to move to.
    as_child: Whether to make the block a child of the target (default: False).
    
Returns:
    Result of the move operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
as_childNo
block_idYes
target_block_idYes

Implementation Reference

  • MCP tool handler for 'move_block'. Decorated with @mcp.tool() which registers it as an MCP tool. Includes input schema via type hints and docstring. Delegates to the LogseqAPIClient instance.
    @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.
        
        Moves a block and all its children to a different location.
        - as_child=True: Block becomes a child of the target
        - as_child=False: Block becomes a sibling after the target
        
        Args:
            block_id: The ID of the block to move.
            target_block_id: The ID of the target block to move to.
            as_child: Whether to make the block a child of the target (default: False).
            
        Returns:
            Result of the move operation.
        """
        return logseq_client.move_block(block_id, target_block_id, as_child)
  • Low-level helper method in LogseqAPIClient that performs the actual API call to Logseq's 'logseq.Editor.moveBlock' endpoint with the required 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
  • Exports 'move_block' tool in __all__ for import in the main MCP server.
    __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",
    ] 
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks critical behavioral details. It mentions moving 'all its children' and the as_child parameter effects, but doesn't disclose permissions needed, whether the operation is reversible, error conditions, or what 'Result of the move operation' entails. For a mutation tool with zero annotation coverage, this is insufficient.

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

Conciseness4/5

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

Well-structured with purpose statement, elaboration, parameter details, and return mention. The bullet points for as_child values are efficient. Slightly verbose in repeating 'block' in parameter explanations, but overall earns its place without fluff.

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

Completeness2/5

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

For a mutation tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It explains parameters well but misses behavioral context (permissions, side effects, error handling) and output details. Should provide more guidance given the complexity.

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?

Schema description coverage is 0%, so the description must compensate fully. It provides clear semantic explanations for all three parameters: block_id identifies what to move, target_block_id specifies where, and as_child defines the relationship with detailed boolean interpretations. This adds significant value beyond the bare schema.

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 ('block and all its children'), distinguishing it from siblings like insert_block (adds new) or remove_block (deletes). The second sentence elaborates on scope, making the purpose unambiguous.

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?

Usage is implied through parameter explanations (as_child=True/False scenarios), but there's no explicit guidance on when to use this tool versus alternatives like insert_block or update_block for structural changes. The description doesn't mention prerequisites or exclusions.

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

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

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