Add search_notes MCP tool #18
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#18
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?
Plan
plan-2026-02-26-tf-modularize-postgres-- Phase 5Repo
forgejo_admin/pal-e-docs-mcpUser Story
As an AI agent using MCP tools
I want a
search_notestool that finds notes by text querySo that I can find relevant knowledge in one MCP call instead of 12+ list/get loops
Context
This is the second PR of Phase 5. The pal-e-docs API will have a new
GET /notes/search?q=...endpoint (deployed first via separate PR on pal-e-docs). This issue adds the MCP tool that wraps it.All existing MCP tools in this repo are thin httpx wrappers over the pal-e-docs API. Follow the same pattern.
Do NOT start this until the pal-e-docs search endpoint is deployed. The API must exist before the MCP tool can call it.
File Targets
Files to modify or create:
src/pal_e_docs_mcp/tools/notes.py— addsearch_notestool functionsrc/pal_e_docs_mcp/server.py— register the new tool (if tools aren't auto-discovered)Files NOT to touch:
Acceptance Criteria
search_notes(query="secrets management")returns ranked results with snippetsquery(required),limit(optional, default 10),note_type(optional),project(optional),status(optional),tags(optional)slug,title,note_type,status,headline,rankhtml_contentin response (token efficiency)Test Expectations
Constraints
tools/notes.pyGET /notes/search?q={query}&limit={limit}¬e_type={note_type}&project={project}&status={status}&tags={tags}Checklist
Related
pal-e-docs-mcpprojectphase-postgres-5-fulltext-searchforgejo_admin/pal-e-docssearch endpoint (must be deployed first)PR #19 Post-Merge Review
BLOCKERS
None.
NITS
Missing
statusfilter parameter. The API endpointGET /notes/searchaccepts an optionalstatusquery parameter (e.g.active,completed,in-progress), butsearch_notesdoes not expose it. The sibling toollist_notesdoes exposestatus. This is a functional gap -- callers cannot filter search results by status without a follow-uplist_notescall.API signature (pal-e-docs
routes/notes.py:178):Recommend adding a
statusparameter tosearch_notesin a follow-up.Truthiness check vs.
is not Nonefornote_type,project,tags. The tool usesif note_type:(truthiness) rather thanif note_type is not None:like it does forlimit. This means an empty string""would silently be dropped instead of being sent to the API. This is consistent withlist_notesso it is not a deviation, but worth noting -- both tools have this same minor inconsistency between how they guardlimit(identity check) vs. string params (truthiness check). In practice, MCP callers will never send empty strings, so this is cosmetic.No tests. The repo has zero test files (only an empty
tests/__init__.py). This is not a regression -- no tool in the repo has tests. Recommend tracking test infrastructure as a separate issue.SOP COMPLIANCE
plan-2026-02-26-tf-modularize-postgres)_ok/_error_response,get_client().get(),Annotated+Field)/notes/search)querymapped correctly toqquery paramVERDICT: APPROVED
Clean, minimal, pattern-compliant. The missing
statusparameter is a gap but non-blocking -- it can be added in a follow-up. The code is correct for the parameters it does expose.