Looking at write_note, I can see it's a complete content replacement tool. An edit_note() tool would be really valuable for incremental changes. Here's my thinking:
Use Cases for edit_note():
- Append new sections to existing notes (most common)
- Update specific information without rewriting everything
- Add observations/relations to existing content
- Fix typos or update facts
- Prepend updates like meeting notes with timestamps
Proposed Design:
@mcp.tool()
async def edit_note(
identifier: str, # title, permalink, or memory:// URL
operation: str, # "append", "prepend", "replace_section", "find_replace"
content: str, # content to add/replace
section: str = None, # for replace_section - header name like "## Notes"
find_text: str = None, # for find_replace
) -> str:
Operations:
- append - Add content to end (most useful) edit_note("project-planning", "append", "\n## New Requirements\n- Feature X\n- Feature Y")
- prepend - Add content to beginning edit_note("meeting-notes", "prepend", "## 2025-05-25 Update\n- Progress on feature...")
- replace_section - Replace content under specific header edit_note("specs/api", "replace_section", "New API design...", section="## Implementation")
- find_replace - Simple text replacement edit_note("config", "find_replace", "v0.13.0", find_text="v0.12.0")
Implementation Flow:
- Use read_note() internally to get current content
- Apply the specified operation
- Use existing PUT /knowledge/entities/{permalink} endpoint
- Return similar summary as write_note()
This would be perfect for AI assistants making targeted updates without having to regenerate entire documents. The append operation alone would handle 80% of use cases.
Want me to implement this? I'd start with just append and prepend for v0.13.0 to keep it simple.