Add semantic_search MCP tool #30

Merged
forgejo_admin merged 2 commits from 29-add-semantic-search-mcp-tool into main 2026-03-09 14:40:39 +00:00

Summary

Adds the semantic_search MCP tool that wraps get_sdk().semantic_search(), which hits GET /notes/semantic-search. Copies the search_notes tool pattern exactly. Bumps pal-e-docs-sdk from 0.1.0 to 0.2.0 in uv.lock to pick up the semantic_search() SDK method merged in SDK PR #20.

Changes

  • src/pal_e_docs_mcp/tools/notes.py -- added semantic_search tool with parameters: query (required), limit, note_type, project, tags, status
  • tests/test_param_alignment.py -- added TestSemanticSearch class with 4 tests (positional arg mapping, optional filter forwarding, defaults-to-none, error handling)
  • uv.lock -- bumped pal-e-docs-sdk 0.1.0 -> 0.2.0

Test Plan

  • All 43 tests pass (uv run pytest tests/ -v), including 4 new semantic_search tests
  • Ruff lint and format checks pass
  • No changes to server.py or other tool modules

Review Checklist

  • No unrelated changes
  • Tests added and passing
  • Ruff lint and format clean
  • PR description includes Closes #N
  • Follows existing code patterns (copied search_notes exactly)
  • Plan: plan-2026-02-26-tf-modularize-postgres
  • Forgejo issue: #29

Closes #29

## Summary Adds the `semantic_search` MCP tool that wraps `get_sdk().semantic_search()`, which hits `GET /notes/semantic-search`. Copies the `search_notes` tool pattern exactly. Bumps `pal-e-docs-sdk` from 0.1.0 to 0.2.0 in `uv.lock` to pick up the `semantic_search()` SDK method merged in SDK PR #20. ## Changes - `src/pal_e_docs_mcp/tools/notes.py` -- added `semantic_search` tool with parameters: `query` (required), `limit`, `note_type`, `project`, `tags`, `status` - `tests/test_param_alignment.py` -- added `TestSemanticSearch` class with 4 tests (positional arg mapping, optional filter forwarding, defaults-to-none, error handling) - `uv.lock` -- bumped `pal-e-docs-sdk` 0.1.0 -> 0.2.0 ## Test Plan - All 43 tests pass (`uv run pytest tests/ -v`), including 4 new semantic_search tests - Ruff lint and format checks pass - No changes to `server.py` or other tool modules ## Review Checklist - [x] No unrelated changes - [x] Tests added and passing - [x] Ruff lint and format clean - [x] PR description includes `Closes #N` - [x] Follows existing code patterns (copied `search_notes` exactly) ## Related - Plan: `plan-2026-02-26-tf-modularize-postgres` - Forgejo issue: #29 Closes #29
Add semantic_search MCP tool wrapping SDK vector search
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
1abf620d16
Copies the search_notes tool pattern exactly: same decorator, parameter
annotations, error handling, and _ok/_error_response helpers. Calls
get_sdk().semantic_search() which hits GET /notes/semantic-search.

Also bumps pal-e-docs-sdk from 0.1.0 to 0.2.0 in uv.lock to pick up
the semantic_search() method added in SDK PR #20.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bump pal-e-docs-sdk floor to >=0.2.0
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
0135d3c26b
The semantic_search tool requires the semantic_search() SDK method
introduced in 0.2.0. Without this floor bump, a fresh install could
resolve to 0.1.0 and cause a runtime AttributeError.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
forgejo_admin deleted branch 29-add-semantic-search-mcp-tool 2026-03-09 14:40:39 +00:00
Sign in to join this conversation.
No description provided.