You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user reported an issue asking the AI to move a file to a new project. The ai attempted the operation, but it was not clear that it did not complete successfully.
Expected Behavior
We don't currently support moving files to a new project. The AI assistant should provide clear feedback to the user.
Actual Behavior
The move_note tool should
return a clear message explaining that notes can't be moved
prompt the assistant to recreate the note in the new project
or the we should add support for moving a note to a new project directly in the code. This is problematic because we would have to pass two project values to the move note operation and we would need an api change.
Recommendation: Start with Option 1, Plan for Option 3
Immediate Solution (Option 1)
Implement enhanced error messaging now because:
User Experience: Eliminates confusion immediately
Low Risk: No architectural changes
Quick Win: Can be implemented and deployed this week
Guidance Value: Helps users understand the system better
Implementation approach:
# In move_note tool, detect cross-project scenariosdefdetect_cross_project_move(identifier, destination_path, current_project):
# Check if destination path references different project# Return helpful error message with alternativeserror_message="""Cannot move notes between different projects directly. Alternative approaches:1. Switch to source project: switch_project("{source_project}")2. Read the note content: read_note("{identifier}") 3. Switch to target project: switch_project("{target_project}")4. Create the note in new location: write_note(title, content, folder)5. Delete from source project if desiredThis preserves your knowledge while moving it between projects safely."""
Future Enhancement (Option 3)
Plan copy_note_to_project tool for next quarter because:
User Demand: If users frequently need this, build proper tooling
Safety First: Copy-then-delete is safer than atomic move
Incremental: Can build on Option 1's validation logic
API Evolution: Allows gradual API enhancement
Why Not Option 2?
Full cross-project moves are high risk, high complexity for a relatively uncommon operation. The copy-and-delete pattern is safer and more explicit about what's happening.
Implementation Plan
Phase 1 (This Week):
Enhance move_note error detection
Add cross-project validation
Improve error messaging with alternatives
Update MCP tool description
Phase 2 (Next Quarter, if demand exists):
Implement copy_note_to_project tool
Add project validation helpers
Create guided workflow prompts
Comprehensive testing
This approach balances immediate user needs with long-term system health while avoiding over-engineering a complex feature before we understand usage patterns.
@claude cool. Can you make a PR for option 1, improving the guidance in the tool response? Also, lets make an integration test in the test-int dir validating the behavior.
@claude can you tell me if the tool usage docs are unclear for move_note?
@mcp.tool(
description="Move a note to a new location, updating database and maintaining links.",
)
async def move_note(
identifier: str,
destination_path: str,
project: Optional[str] = None,
) -> str:
"""Move a note to a new file location within the same project.
Args:
identifier: Exact entity identifier (title, permalink, or memory:// URL).
Must be an exact match - fuzzy matching is not supported for move operations.
Use search_notes() or read_note() first to find the correct identifier if uncertain.
destination_path: New path relative to project root (e.g., "work/meetings/2025-05-26.md")
project: Optional project name (defaults to current session project)
Returns:
Success message with move details
Examples:
# Move to new folder (exact title match)
move_note("My Note", "work/notes/my-note.md")
# Move by exact permalink
move_note("my-note-permalink", "archive/old-notes/my-note.md")
# Specify project with exact identifier
move_note("My Note", "archive/my-note.md", project="work-project")
# If uncertain about identifier, search first:
# search_notes("my note") # Find available notes
# move_note("docs/my-note-2025", "archive/my-note.md") # Use exact result
Note: This operation moves notes within the specified project only. Moving notes
between different projects is not currently supported.
The move operation:
- Updates the entity's file_path in the database
- Moves the physical file on the filesystem
- Optionally updates permalinks if configured
- Re-indexes the entity for search
- Maintains all observations and relations
"""
The intended usage is that the you can move a note within a particular project by passing the project arg. This is meant for the case where the project is not currently active. It is not meant to move a note to a different project. That use case is not supported because it would require us to pass two project args, source and destination.
Yes, the documentation is unclear and needs improvement. The current docstring has several confusing aspects that would mislead AI assistants about the project parameter's purpose.
Todo List
Read current move_note tool implementation
Analyze docstring clarity issues
Provide specific improvement recommendations
Key Clarity Problems
1. Contradictory Language
Line 220: "Move a note to a new file location within the same project"
But then provides a project parameter that can specify a different project
This creates cognitive dissonance about what "same project" means
2. Ambiguous Parameter Description
Current: project: Optional project name (defaults to current session project)
Problem: Doesn't explain that when specified, ALL operations happen within that project
Misleading: Implies it's just a "default" rather than a context switch
3. Insufficient Examples
Current examples don't clearly demonstrate the cross-project context scenario
Missing example showing: "AI working in project A, but moving note within project B"
4. Unclear Scope Statement
"Moving notes between different projects is not currently supported" appears to contradict the project parameter
Specific Improvement Recommendations
1. Fix the Main Description
# Current (confusing):"""Move a note to a new file location within the same project.# Improved (clear):"""Moveanotetoanewfilelocationwithinaspecifiedproject.
# Add this example to demonstrate cross-project context:# Move note within different project (while AI is in project "main")move_note("meeting_notes.md", "archive/meeting_notes.md", project="work-notes")
# ^ This finds "meeting_notes.md" in the "work-notes" project and moves it there
"""Move a note to a new file location within a specified project.Args: identifier: Exact entity identifier (title, permalink, or memory:// URL). Must be an exact match - fuzzy matching is not supported for move operations. Use search_notes() or read_note() first to find the correct identifier if uncertain. destination_path: New path relative to project root (e.g., "work/meetings/2025-05-26.md") project: Optional project name to operate within. If specified, the note will be found and moved within that project's context, not the current session project. Defaults to current session project if not specified.Returns: Success message with move detailsExamples: # Move within current session project move_note("My Note", "work/notes/my-note.md") # Move within a different project (AI in "main", moving note in "work-project") move_note("Meeting Notes", "archive/meeting-notes.md", project="work-project") # ^ Finds "Meeting Notes" in "work-project" and moves it to archive within "work-project" # If uncertain about identifier, search first: # search_notes("my note") # Find available notes # move_note("docs/my-note-2025", "archive/my-note.md") # Use exact resultNote: This operation moves notes within a single project only. The 'project' parameter specifies which project context to operate within, not a destination project.Moving notes FROM one project TO another project is not supported.The move operation:- Updates the entity's file_path in the database- Moves the physical file on the filesystem - Optionally updates permalinks if configured- Re-indexes the entity for search- Maintains all observations and relations"""
Impact on AI Assistant Behavior
The current unclear documentation could lead to:
Confusion about when to use the project parameter
Incorrect assumptions about cross-project moves being supported
Poor error handling when users request actual cross-project moves
The improved documentation would:
Clearly communicate the single-project limitation
Explicitly explain the project parameter's context-switching behavior
Provide better examples for both same-project and cross-project-context scenarios
Reduce confusion about what operations are and aren't supported
Summary
Yes, improving the tool usage documentation would significantly help. The current docstring is ambiguous about the project parameter's purpose and creates confusion about supported vs unsupported operations. The recommended changes would provide much clearer guidance for AI assistants using this tool.
Activity
phernandez commentedon Jun 20, 2025
@claude can you consider some options for addressing this issue?
claude commentedon Jun 20, 2025
Claude finished @phernandez's task —— View job
Analysis Complete
I've thoroughly analyzed the cross-project move issue and have several solution options to consider.
Current State Analysis
The
move_notetool is well-implemented for within-project moves but has poor user experience for cross-project attempts:What happens now:
move_notetool silently fails or provides unclear feedbackTechnical Architecture:
project_id)Solution Options
Option 1: Enhanced Error Messaging (Low Complexity) ⭐
Approach: Detect cross-project moves and provide clear guidance
Implementation:
move_notetoolPros:
Cons:
Option 2: Full Cross-Project Move Support (High Complexity)
Approach: Implement true cross-project moves
Implementation:
Pros:
Cons:
Option 3: Copy-and-Delete Workflow (Medium Complexity)
Approach: Implement as two-step operation
Implementation:
copy_note_to_project(identifier, target_project, new_path?)tooldelete_notewith confirmationmove_note_to_projectwrapper combining bothPros:
Cons:
Option 4: Export/Import Pattern (Medium Complexity)
Approach: Use existing export/import mechanisms
Implementation:
Pros:
Cons:
Recommendation: Start with Option 1, Plan for Option 3
Immediate Solution (Option 1)
Implement enhanced error messaging now because:
Implementation approach:
Future Enhancement (Option 3)
Plan
copy_note_to_projecttool for next quarter because:Why Not Option 2?
Full cross-project moves are high risk, high complexity for a relatively uncommon operation. The copy-and-delete pattern is safer and more explicit about what's happening.
Implementation Plan
Phase 1 (This Week):
move_noteerror detectionPhase 2 (Next Quarter, if demand exists):
copy_note_to_projecttoolThis approach balances immediate user needs with long-term system health while avoiding over-engineering a complex feature before we understand usage patterns.
phernandez commentedon Jun 20, 2025
@claude cool. Can you make a PR for option 1, improving the guidance in the tool response? Also, lets make an integration test in the test-int dir validating the behavior.
claude commentedon Jun 20, 2025
Claude finished @phernandez's task —— View job •
claude/issue-157-20250620_141726• Create PR ➔Implementation Complete ✅
Enhanced
move_notetool with cross-project detection:_detect_cross_project_move_attempt()function to detect project names in destination pathsmove_notefunction before API callIntegration tests added:
test_move_note_cross_project_detection()- Tests exact project name detection in pathstest_move_note_potential_cross_project_guidance()- Tests project-like keyword detectiontest_move_note_normal_moves_still_work()- Ensures normal moves aren't affectedKey Features:
"other-project/file.md")"project","workspace","repo")Changes Committed
src/basic_memory/mcp/tools/move_note.pywith cross-project detectiontest-int/mcp/test_move_note_integration.pyf995258- "feat: enhance move_note tool with cross-project detection and guidance"feat: enhance move_note tool with cross-project detection and guidance
phernandez commentedon Jun 25, 2025
@claude can you tell me if the tool usage docs are unclear for move_note?
The intended usage is that the you can move a note within a particular project by passing the project arg. This is meant for the case where the project is not currently active. It is not meant to move a note to a different project. That use case is not supported because it would require us to pass two project args, source and destination.
Examples:
Supported:
Ambiguous:
Would imporoving the tool usage docs help here?
claude commentedon Jun 25, 2025
Claude finished @phernandez's task —— View job
Analysis:
move_noteDocumentation Clarity IssuesYes, the documentation is unclear and needs improvement. The current docstring has several confusing aspects that would mislead AI assistants about the
projectparameter's purpose.Todo List
Key Clarity Problems
1. Contradictory Language
projectparameter that can specify a different project2. Ambiguous Parameter Description
project: Optional project name (defaults to current session project)3. Insufficient Examples
4. Unclear Scope Statement
projectparameterSpecific Improvement Recommendations
1. Fix the Main Description
2. Clarify the Project Parameter
3. Add Clear Examples
4. Clarify the Limitation Statement
Recommended Complete Docstring
Impact on AI Assistant Behavior
The current unclear documentation could lead to:
projectparameterThe improved documentation would:
Summary
Yes, improving the tool usage documentation would significantly help. The current docstring is ambiguous about the
projectparameter's purpose and creates confusion about supported vs unsupported operations. The recommended changes would provide much clearer guidance for AI assistants using this tool.