Skip to content

ToolRegistry

Defined in: core/src/tools.ts:206

new ToolRegistry(tools?): ToolRegistry;

Defined in: core/src/tools.ts:209

Parameter Type Default value
tools readonly Tool<unknown, unknown>[] []

ToolRegistry

get names(): string[];

Defined in: core/src/tools.ts:226

string[]

definitions(allow?): ToolDefinition[];

Defined in: core/src/tools.ts:236

Definitions for an allow-list, in the order given. This is the order the model reads them in, and it is part of the cached prompt prefix. Reordering or appending mid-conversation invalidates that prefix, so a caller that cares should freeze the list when the session opens.

Parameter Type
allow? readonly string[]

ToolDefinition[]


get(name):
| Tool<unknown, unknown>
| undefined;

Defined in: core/src/tools.ts:218

Parameter Type
name string

| Tool<unknown, unknown> | undefined


has(name): boolean;

Defined in: core/src/tools.ts:222

Parameter Type
name string

boolean


register(tool): this;

Defined in: core/src/tools.ts:213

Parameter Type
tool Tool

this