feat(notes): Allow listing all the notes (not truncated)

This commit is contained in:
famez
2026-02-28 23:22:51 +01:00
parent 64a78f2e97
commit 016dbcf333

View File

@@ -148,12 +148,12 @@ def _validate_note_schema(category: str, metadata: Dict[str, Any]) -> str | None
@register_tool(
name="notes",
description="Manage persistent notes for key findings. Actions: create, read, update, delete, list.",
description="Manage persistent notes for key findings. Actions: create, read, update, delete, list (2 options, all or the truncated text to 60 characters).",
schema=ToolSchema(
properties={
"action": {
"type": "string",
"enum": ["create", "read", "update", "delete", "list"],
"enum": ["create", "read", "update", "delete", "list_all", "list_truncated"],
"description": "The action to perform",
},
"key": {
@@ -399,7 +399,7 @@ async def notes(arguments: dict, runtime) -> str:
_save_notes_unlocked()
return f"Deleted note '{key}'"
elif action == "list":
elif action == "list_all" or action == "list_truncated":
if not _notes:
return "No notes saved"
@@ -417,9 +417,13 @@ async def notes(arguments: dict, runtime) -> str:
lines.append(f"\n## {cat.title()}")
for k, v in by_category[cat]:
content = v["content"]
display_val = (
content if len(content) <= 60 else content[:57] + "..."
)
display_val = content
if action == "list_truncated":
display_val = (
content if len(content) <= 60 else content[:57] + "..."
)
conf = v.get("confidence", "medium")
lines.append(f" [{k}] ({conf}) {display_val}")