Enable notes_search_results and get_note tools

This commit is contained in:
Chris Coutinho
2025-05-05 01:16:51 +02:00
parent 37d9d45962
commit be6c76fa2b
2 changed files with 37 additions and 13 deletions
+18 -1
View File
@@ -136,8 +136,25 @@ class NextcloudClient:
response.raise_for_status()
return response.json()
def notes_search_notes(self, *, query: str):
all_notes = self.notes_get_all()
search_results = []
query_lower = query.lower()
for note in all_notes:
title_lower = note.get("title", "").lower()
content_lower = note.get("content", "").lower()
if query_lower in title_lower or query_lower in content_lower:
search_results.append(
{
"id": note.get("id"),
"title": note.get("title"),
"category": note.get("category"),
"modified": note.get("modified"),
}
)
return search_results
def notes_delete_note(self, *, note_id: int):
response = self._client.delete(f"index.php/apps/notes/api/v1/notes/{note_id}")
response.raise_for_status()
return response.json()