Transforms
Reshape the tool catalog a client sees: progressive search, code mode, and visibility
Every tool your server registers is normally sent to the client in tools/list, schema and all. With a few tools that's fine. With hundreds, the catalog alone can fill the model's context before the conversation starts. Transforms sit between your tools and the client and reshape that catalog: they can hide tools until they're needed, replace the catalog with a search tool, or let the model run several tools from one script.
Why transforms
A large catalog costs tokens on every request and gives the model more tools to confuse with each other. Transforms send a small, stable catalog instead, and reveal the rest on demand.
- 100+ full tool schemas on every request
- 15,000 to 40,000 tokens of catalog
- More tools for the model to confuse
- Too large for small-context models
- search_tools and call_tool
- Plus the tools you mark alwaysVisible
- Schemas fetched only when needed
- The same small catalog for every model
How a catalog request flows
Transforms run in the order you list them in @McpApp. A typical setup filters hidden tools first, then collapses what's left into a search tool.
You add transforms in @McpApp:
@McpApp({
module: AppModule,
server: { name: 'enterprise-service', version: '1.0.0' },
transforms: [
new VisibilityTransform(),
new BM25SearchTransform({ defaultLimit: 5, alwaysVisible: ['auth_login'] }),
],
})Transforms
Progressive Search
Collapse the catalog into a search tool and a call tool.
Code Mode
Run several tools from one script, in a sandbox.
Visibility
Hide tools until a session unlocks them.
Write a Transform
The transform interface, order, and catalog bypass.
