fastmcp/tests/server/transforms
Jeremiah Lowin c96c0400f3
feat: Search transforms for tool discovery (#3154)
* feat: Add search transforms for tool discovery

RegexSearchTransform and BM25SearchTransform collapse large tool
catalogs into a search interface so LLMs discover tools on demand
instead of receiving the full listing.

* chore: Update SDK documentation

* fix: call_tool recursion guard, atomic BM25 rebuild, hash includes descriptions

* Extract CatalogTransform base class for catalog-aware transforms

Transforms that replace list_tools() with synthetic components (like
search) need to read the real catalog at call time without triggering
their own replacement logic. CatalogTransform handles the re-entrant
bypass via per-instance ContextVar, exposing transform_tools() as the
subclass hook and get_tool_catalog() for catalog access.

* Add search transform examples for regex and BM25

* Add README for search transform examples

* Polish search example clients with rich output

* Remove hardcoded tool counts from search example subtitles

* Clarify that review bot feedback should be evaluated on its merits

* Expand search transform docs with proper hierarchy

---------

Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com>
2026-02-26 22:42:38 -05:00
..
test_catalog.py feat: Search transforms for tool discovery (#3154) 2026-02-26 22:42:38 -05:00
test_prompts_as_tools.py Add PromptsAsTools transform (#2946) 2026-01-19 18:19:53 -05:00
test_resources_as_tools.py Add ResourcesAsTools transform (#2943) 2026-01-19 17:40:31 -05:00
test_search.py feat: Search transforms for tool discovery (#3154) 2026-02-26 22:42:38 -05:00
test_visibility.py Fix session visibility marks leaking across sessions (#3132) 2026-02-10 11:42:43 -05:00