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' }
schemaOnError?
optionalschemaOnError?:"always"|"invalidArguments"
Defined in: deferTools.ts:59
Which failed calls carry the tool's input schema.
'invalidArguments'— only arguments that fail the tool's schema, so acallmade withoutdescribecorrects itself in one retry. A tool's own error result or a thrown error is usually a refusal of the operation (a 404, a 409), and a large schema on every refusal costs more context than deferring saved.'always'— those carry it too. For tools that do not validate their arguments, whose errors may be argument errors only the API detects.
Default
'invalidArguments'
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:70
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 }),