Skip to main content

Interface: DeferToolsOptions

Defined in: deferTools.ts:13

How registerTools defers tools behind search / describe / call.

Properties​

except?​

optional except?: (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​

ParameterType
args{ tool: Tool; }
args.toolTool

Returns​

boolean


names?​

optional names?: 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?​

optional call?: string

describe?​

optional describe?: string

optional search?: string

Default​

{ search: 'search', describe: 'describe', call: 'call' }

search?​

optional search?: (args) => Tool[] | Promise<Tool[]>

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​

ParameterType
argsToolSearchArgs

Returns​

Tool[] | Promise<Tool[]>


searchLimit?​

optional searchLimit?: number

Defined in: deferTools.ts:39

How many tools search returns when the model does not say.

Default​

10

searchMaxLimit?​

optional searchMaxLimit?: 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?​

optional visible?: (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​

ParameterType
args{ tool: Tool; }
args.toolTool

Returns​

boolean

Example​

visible: ({ tool }) => canUse({ identity: getIdentity(), tool: tool.name }),