-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Add an update_block tool that edits the content of an existing block by UUID. This is the only missing piece of block-level CRUD — read (get_page_content), create (insert_nested_block), and delete (delete_block) are all covered.
Motivation
Currently there's no way to modify an existing block's text without deleting and recreating it. Common use cases:
- Fix a typo in a specific block
- Update a task's status marker
- Edit a block that was found via
searchorquery
Proposed API
Tool name: update_block
Input schema:
{
"block_uuid": "string (required) — UUID of the block to edit",
"content": "string (required) — new content to replace the block's current text"
}Underlying Logseq API: logseq.Editor.updateBlock(blockUUID, content)
Implementation Notes
logseq.Editor.updateBlockis part of the plugin API and should be available via HTTP- Returns
nullon success (likeremoveBlock) - Should follow the existing emoji-prefix pattern: ✅ on success, ❌ on error
- Needs unit tests in
test_logseq_api.pyandtest_tool_handlers.py
Acceptance Criteria
-
LogSeq.update_block(block_uuid, content)method inlogseq.py -
UpdateBlockToolHandlerintools.py - Registered in
server.py - Unit tests for both the API method and the handler
- Integration test
expected_toolsupdated (15 tools) - README tool table updated
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request