Interface: DeferToolsOptions
Defined in: deferTools.ts:13
How registerTools defers tools behind search / describe / call.
Properties
except?
optionalexcept?: (args) =>boolean
Defined in: deferTools.ts:22
Tools that are not deferred: they are also registered as standalone MCP
tools, and stay reachable through search / describe / call too.
Defaults to the tools linked to an MCP Apps view: a host finds a tool's
view through that tool's own tools/list entry, so a view behind call
would never render.
Parameters
| Parameter | Type |
|---|---|
args | { tool: Tool; } |
args.tool | Tool |
Returns
boolean
names?
optionalnames?:object
Defined in: deferTools.ts:28
The names of the three tools that reach the deferred ones, to avoid a collision with a standalone tool or to defer two sets on one server.
call?
optionalcall?:string
describe?
optionaldescribe?:string
search?
optionalsearch?:string
Default
{ search: 'search', describe: 'describe', call: 'call' }
search?
Defined in: deferTools.ts:34
Replaces the default ranking, e.g. with embeddings. Receives only the
tools visible lets through; the result is cut to limit.
rankTools is the default, for a fallback.
Parameters
| Parameter | Type |
|---|---|
args | ToolSearchArgs |
Returns
searchLimit?
optionalsearchLimit?:number
Defined in: deferTools.ts:39
How many tools search returns when the model does not say.
Default
10
searchMaxLimit?
optionalsearchMaxLimit?:number
Defined in: deferTools.ts:45
The largest limit search accepts. With no ceiling, an empty query
lists every tool, more than a client's context holds.
Default
50, or searchLimit when that is higher
visible?
optionalvisible?: (args) =>boolean
Defined in: deferTools.ts:56
Runs on every search, describe and call. A tool it rejects is
absent from all three; call answers it as an unknown name. Tools
except keeps standalone are listed on tools/list regardless.
Parameters
| Parameter | Type |
|---|---|
args | { tool: Tool; } |
args.tool | Tool |
Returns
boolean
Example
visible: ({ tool }) => canUse({ identity: getIdentity(), tool: tool.name }),