Skip to content

fix: [BUG] Cursor has errors calling search tool#78

Merged
phernandez merged 3 commits into
mainfrom
fix-issue-75-20250405180254
Apr 6, 2025
Merged

fix: [BUG] Cursor has errors calling search tool#78
phernandez merged 3 commits into
mainfrom
fix-issue-75-20250405180254

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 5, 2025

This PR fixes issue #75

Changes Summary

Fixed issue #75 where Cursor was having errors calling the search_notes tool. The problem was that the search_notes tool was expecting a complex Pydantic object (SearchQuery) as input, which was confusing Cursor.

Changes:

  1. Modified the search_notes tool to accept primitive types (strings, lists, etc.) as parameters instead of a complex Pydantic object
  2. Updated the implementation to create a SearchQuery object internally from these primitive parameters
  3. Updated all call sites in the codebase that were using the old function signature
  4. Updated tests to use the new function signature

The fix makes it easier for LLMs like Cursor to make proper calls to the search_notes tool, which will resolve the reported error messages:

  • "Parameter 'query' must be of type undefined, got object"
  • "Parameter 'query' must be of type undefined, got string"
  • "Invalid type for parameter 'query' in tool search_notes"

Files modified:

  • src/basic_memory/mcp/tools/search.py
  • src/basic_memory/mcp/tools/read_note.py
  • src/basic_memory/mcp/prompts/search.py
  • tests/mcp/test_tool_search.py
  • tests/mcp/test_tool_read_note.py

Original Issue

Bug Description

Cursor cannot figure out how to structure the parameters for that tool call. No matter what Cursor seems to try it gets the errors.

- When I pass an object: "Parameter 'query' must be of type undefined, got object"
- When I pass a string: "Parameter 'query' must be of type undefined, got string"



 and then it reports:  "Invalid type for parameter 'query' in tool search_notes"
Any chance you can give me some guidance with this?

Steps To Reproduce

Steps to reproduce the behavior:

try using search tool in Cursor.

Possible Solution

The tool args should probably be plain text and not json to make it easier to call.


🤖 Generated with Claude Code GitHub Action

@phernandez phernandez changed the title Fix: [BUG] Cursor has errors calling search tool fix: [BUG] Cursor has errors calling search tool Apr 5, 2025
bm-claudeai and others added 3 commits April 5, 2025 18:24
Automated fix generated by Claude Code based on issue analysis.

---
🤖 Generated with Claude Code GitHub Action

Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
Updated the naming conventions and handling of `types` and `entity_types` across the codebase for consistency. Modified function definitions, queries, and filters to ensure clear separation and proper usage. Adjusted and added tests to align with the new structure.

Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez phernandez force-pushed the fix-issue-75-20250405180254 branch from 272f533 to 4be95bc Compare April 5, 2025 23:24
@phernandez phernandez merged commit 9d581ce into main Apr 6, 2025
7 checks passed
@phernandez phernandez deleted the fix-issue-75-20250405180254 branch April 6, 2025 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants