Skip to content

Commit f7a1b49

Browse files
committed
remove project parameter from search
Signed-off-by: Drew Cain <groksrc@gmail.com>
1 parent b906592 commit f7a1b49

4 files changed

Lines changed: 5 additions & 21 deletions

File tree

src/basic_memory/mcp/tools/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"delete_project",
3636
"edit_note",
3737
"fetch",
38-
"get_current_project",
3938
"list_directory",
4039
"list_memory_projects",
4140
"move_note",

src/basic_memory/mcp/tools/chatgpt_tools.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,25 @@ def _format_document_for_chatgpt(
7777
)
7878
async def search(
7979
query: str,
80-
project: Optional[str] = None,
8180
context: Context | None = None,
8281
) -> List[Dict[str, Any]]:
8382
"""ChatGPT/OpenAI MCP search adapter returning a single text content item.
8483
8584
Args:
8685
query: Search query (full-text syntax supported by `search_notes`)
87-
project: Optional project name for multi-project support
8886
context: Optional FastMCP context passed through for auth/session data
8987
9088
Returns:
9189
List with one dict: `{ "type": "text", "text": "{...JSON...}" }`
9290
where the JSON body contains `results`, `total_count`, and echo of `query`.
9391
"""
94-
logger.info(f"ChatGPT search request: query='{query}', project='{project}'")
92+
logger.info(f"ChatGPT search request: query='{query}'")
9593

9694
try:
9795
# Call underlying search_notes with sensible defaults for ChatGPT
9896
results = await search_notes.fn(
9997
query=query,
100-
project=project,
98+
project=None, # Let project resolution happen automatically
10199
page=1,
102100
page_size=10, # Reasonable default for ChatGPT consumption
103101
search_type="text", # Default to full-text search
@@ -150,27 +148,25 @@ async def search(
150148
)
151149
async def fetch(
152150
id: str,
153-
project: Optional[str] = None,
154151
context: Context | None = None,
155152
) -> List[Dict[str, Any]]:
156153
"""ChatGPT/OpenAI MCP fetch adapter returning a single text content item.
157154
158155
Args:
159156
id: Document identifier (permalink, title, or memory URL)
160-
project: Optional project name for multi-project support
161157
context: Optional FastMCP context passed through for auth/session data
162158
163159
Returns:
164160
List with one dict: `{ "type": "text", "text": "{...JSON...}" }`
165161
where the JSON body includes `id`, `title`, `text`, `url`, and metadata.
166162
"""
167-
logger.info(f"ChatGPT fetch request: id='{id}', project='{project}'")
163+
logger.info(f"ChatGPT fetch request: id='{id}'")
168164

169165
try:
170166
# Call underlying read_note function
171167
content = await read_note.fn(
172168
identifier=id,
173-
project=project,
169+
project=None, # Let project resolution happen automatically
174170
page=1,
175171
page_size=10, # Default pagination
176172
context=context

test-int/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def app_config(config_home, tmp_path, monkeypatch) -> BasicMemoryConfig:
122122
env="test",
123123
projects=projects,
124124
default_project="test-project",
125+
default_project_mode=True,
125126
update_permalinks_on_move=True,
126127
)
127128
return app_config

test-int/mcp/test_chatgpt_tools_integration.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ async def test_chatgpt_search_basic(mcp_server, app, test_project):
7878
"search",
7979
{
8080
"query": "Machine Learning",
81-
"project": test_project.name,
8281
},
8382
)
8483

@@ -109,7 +108,6 @@ async def test_chatgpt_search_empty_results(mcp_server, app, test_project):
109108
"search",
110109
{
111110
"query": "NonExistentTopic12345",
112-
"project": test_project.name,
113111
},
114112
)
115113

@@ -156,7 +154,6 @@ async def test_chatgpt_search_with_boolean_operators(mcp_server, app, test_proje
156154
"search",
157155
{
158156
"query": "Python AND frameworks",
159-
"project": test_project.name,
160157
},
161158
)
162159

@@ -208,7 +205,6 @@ def wrapper(*args, **kwargs):
208205
"fetch",
209206
{
210207
"id": "Advanced Python Techniques",
211-
"project": test_project.name,
212208
},
213209
)
214210

@@ -249,7 +245,6 @@ async def test_chatgpt_fetch_by_permalink(mcp_server, app, test_project):
249245
"search",
250246
{
251247
"query": "Test Document",
252-
"project": test_project.name,
253248
},
254249
)
255250

@@ -262,7 +257,6 @@ async def test_chatgpt_fetch_by_permalink(mcp_server, app, test_project):
262257
"fetch",
263258
{
264259
"id": permalink,
265-
"project": test_project.name,
266260
},
267261
)
268262

@@ -283,7 +277,6 @@ async def test_chatgpt_fetch_nonexistent_document(mcp_server, app, test_project)
283277
"fetch",
284278
{
285279
"id": "NonExistentDocument12345",
286-
"project": test_project.name,
287280
},
288281
)
289282

@@ -322,7 +315,6 @@ async def test_chatgpt_fetch_with_empty_title(mcp_server, app, test_project):
322315
"fetch",
323316
{
324317
"id": "untitled-note",
325-
"project": test_project.name,
326318
},
327319
)
328320

@@ -359,7 +351,6 @@ async def test_chatgpt_search_pagination_default(mcp_server, app, test_project):
359351
"search",
360352
{
361353
"query": "Test Note",
362-
"project": test_project.name,
363354
},
364355
)
365356

@@ -381,7 +372,6 @@ async def test_chatgpt_tools_error_handling(mcp_server, app, test_project):
381372
"search",
382373
{
383374
"query": "", # Empty query might cause an error
384-
"project": test_project.name,
385375
},
386376
)
387377

@@ -444,7 +434,6 @@ async def test_chatgpt_integration_workflow(mcp_server, app, test_project):
444434
"search",
445435
{
446436
"query": "API",
447-
"project": test_project.name,
448437
},
449438
)
450439

@@ -457,7 +446,6 @@ async def test_chatgpt_integration_workflow(mcp_server, app, test_project):
457446
"fetch",
458447
{
459448
"id": first_result_id,
460-
"project": test_project.name,
461449
},
462450
)
463451

0 commit comments

Comments
 (0)