6d: Add semantic_search MCP tool #29
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-mcp#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-2026-02-26-tf-modularize-postgres→ Phase 6 (Vector Search) → Phase 6d (Semantic Search) → Deliverable 3 (MCP)Repo
forgejo_admin/pal-e-docs-mcpUser Story
As an AI agent using Claude Code
I want a
semantic_searchMCP toolSo that I can find related knowledge by meaning directly from my tool context
Context
PR #138 on pal-e-docs added
GET /notes/semantic-search. PR #20 on pal-e-docs-sdk addedclient.semantic_search(). This issue adds the MCP tool wrapper.The
search_notestool insrc/pal_e_docs_mcp/tools/notes.py(lines 50-84) is the exact pattern to copy.File Targets
Files to modify:
src/pal_e_docs_mcp/tools/notes.py— addsemantic_searchtool (copysearch_notespattern, callget_sdk().semantic_search())Files to create:
Files to reference (don't modify):
src/pal_e_docs_mcp/server.py— server setup, SDK initializationAcceptance Criteria
semantic_searchtool registered and callablequery(required),limit,note_type,project,tags,statusget_sdk().semantic_search(query, ...)_ok()helper on success_error_response()on failureTest Expectations
Constraints
search_notestool pattern exactly — same decorator, same parameter annotations, same error handlingChecklist
Closes #NRelated
phase-postgres-6d-semantic-search— phase notePR #30 Review
BLOCKERS
1.
pyproject.tomlSDK version constraint not bumped (line 14)The dependency is still
pal-e-docs-sdk>=0.1.0, but the newsemantic_searchtool callsget_sdk().semantic_search()-- a method that only exists in SDK 0.2.0+. If the dependency resolver picks 0.1.0 (which the constraint allows), the tool crashes at runtime withAttributeError.Fix: bump to
pal-e-docs-sdk>=0.2.0inpyproject.toml.File:
/home/ldraney/pal-e-docs-mcp/pyproject.toml, line 14.NITS
None. The implementation is a clean, minimal copy of the
search_notespattern.SOP COMPLIANCE
29-add-semantic-search-mcp-toolreferences #29)plan-2026-02-26-tf-modularize-postgres)Closes #29present in PR body.envfiles, or credentials committedTestSemanticSearch, total 43 passing)CODE REVIEW
Tool implementation (
notes.pylines 87-122): Near-exact copy ofsearch_notes. Decorator, parameter annotations, docstring, try/except,_ok/_error_response-- all match. Positionalqueryarg forwarded correctly to SDK. All 6 parameters present and in the same order assearch_notes.Tests (
test_param_alignment.pylines 128-166): Four tests cover the key boundary behaviors -- positional arg mapping, optional filter forwarding, defaults-to-none, and error response formatting. Mirrors the existingTestSearchNotespattern but with fuller coverage.SDK bump (
uv.lock): Correctly bumped from 0.1.0 to 0.2.0 with updated hashes. However,pyproject.tomlwas missed (see BLOCKER above).Registration: No changes needed to
__init__.pysincesemantic_searchis defined innotes.pywhich is already imported byregister_all_tools().VERDICT: NOT APPROVED
One blocker:
pyproject.tomlmust bump the SDK floor to>=0.2.0to match the runtime requirement. Everything else is solid.