delete_note
Remove a specific note from Google Keep by providing its unique ID. The tool marks the note for deletion, ensuring efficient note management and cleanup.
Instructions
Delete a note (mark for deletion).
Args:
note_id (str): The ID of the note to delete
Returns:
str: Success message
Raises:
ValueError: If the note doesn't exist or cannot be modified
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note_id | Yes |
Implementation Reference
- src/server/cli.py:89-113 (handler)The handler function for the 'delete_note' tool. It retrieves the note by ID, checks if it exists and can be modified (via keep-mcp label or UNSAFE_MODE), marks it for deletion, syncs changes, and returns a JSON success message.def delete_note(note_id: str) -> str: """ Delete a note (mark for deletion). Args: note_id (str): The ID of the note to delete Returns: str: Success message Raises: ValueError: If the note doesn't exist or cannot be modified """ keep = get_client() note = keep.get(note_id) if not note: raise ValueError(f"Note with ID {note_id} not found") if not can_modify_note(note): raise ValueError(f"Note with ID {note_id} cannot be modified (missing keep-mcp label and UNSAFE_MODE is not enabled)") note.delete() keep.sync() # Ensure deletion is saved to the server return json.dumps({"message": f"Note {note_id} marked for deletion"})