Skip to content

Add delete_block tool to remove blocks by UUID#15

Open
arndjan wants to merge 1 commit intoergut:mainfrom
arndjan:feature/delete-block
Open

Add delete_block tool to remove blocks by UUID#15
arndjan wants to merge 1 commit intoergut:mainfrom
arndjan:feature/delete-block

Conversation

@arndjan
Copy link

@arndjan arndjan commented Feb 4, 2026

Summary

Adds support for deleting blocks via the logseq.Editor.removeBlock API method.

Changes

  • Added delete_block(block_uuid) method to LogSeq class in logseq.py
  • Added DeleteBlockToolHandler class in tools.py
  • Registered the new tool handler in server.py

Usage

# MCP tool call
{
  "name": "delete_block",
  "arguments": {
    "block_uuid": "6983204d-ef32-4fbf-b19c-02181f16b28e"
  }
}

Motivation

Currently the MCP server supports creating and editing blocks, but not deleting them. This makes it impossible to clean up test blocks or remove unwanted content programmatically.

The underlying Logseq API already supports this via logseq.Editor.removeBlock, so this PR simply exposes that functionality.

Closes #14

🤖 Generated with Claude Code

Adds logseq.Editor.removeBlock API support:
- New delete_block method in LogSeq class
- New DeleteBlockToolHandler for MCP tool interface
- Registered in server.py

Closes ergut#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add delete_block / remove_block tool

1 participant