Add MongoDB-backed NotesTool with CRUD actions and unit tests (#1982)

* Add MongoDB-backed NotesTool with CRUD actions and unit tests

* NotesTool: enforce single note per user, require decoded_token['sub'] user_id, fix tests

* chore: remove accidentally committed results.txt and ignore it

* fix: remove results.txt, enforce single note per user, add tests

* refactor: update NotesTool actions and tests for clarity and consistency

* refactor: update NotesTool docstring for clarity

* refactor: simplify MCPTool docstring and remove redundant import in test_notes_tool

* lint: fix test

* refactor: remove unused import from test_notes_tool.py

---------

Co-authored-by: Alex <a@tushynski.me>
This commit is contained in:
Dhairya Parikh
2025-10-06 12:24:03 -04:00
committed by GitHub
parent 7cfc230316
commit 4c31e9a8b1
5 changed files with 323 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ class ToolManager:
module = importlib.import_module(f"application.agents.tools.{tool_name}")
for member_name, obj in inspect.getmembers(module, inspect.isclass):
if issubclass(obj, Tool) and obj is not Tool:
if tool_name == "mcp_tool" and user_id:
if tool_name in {"mcp_tool","notes"} and user_id:
return obj(tool_config, user_id)
else:
return obj(tool_config)