Defined in: packages/typescript/ai/src/tool-registry.ts:9
A registry that holds tools and allows dynamic tool management.
The registry can be either mutable (allowing additions/removals during execution) or frozen (static tool list, for backward compatibility with tools arrays).
add: (tool) => void;add: (tool) => void;Defined in: packages/typescript/ai/src/tool-registry.ts:22
Add a tool to the registry dynamically. For frozen registries, this is a no-op.
The tool to add
void
get: (name) =>
| Tool<SchemaInput, SchemaInput, string>
| undefined;get: (name) =>
| Tool<SchemaInput, SchemaInput, string>
| undefined;Defined in: packages/typescript/ai/src/tool-registry.ts:46
Get a tool by name.
string
The name of the tool to get
| Tool<SchemaInput, SchemaInput, string> | undefined
The tool if found, undefined otherwise
getTools: () => readonly Tool<SchemaInput, SchemaInput, string>[];getTools: () => readonly Tool<SchemaInput, SchemaInput, string>[];Defined in: packages/typescript/ai/src/tool-registry.ts:14
Get all current tools in the registry. Called each agent loop iteration to get the latest tool list.
readonly Tool<SchemaInput, SchemaInput, string>[]
has: (name) => boolean;has: (name) => boolean;Defined in: packages/typescript/ai/src/tool-registry.ts:38
Check if a tool exists in the registry.
string
The name of the tool to check
boolean
readonly isFrozen: boolean;readonly isFrozen: boolean;Defined in: packages/typescript/ai/src/tool-registry.ts:52
Whether this registry is frozen (immutable). Frozen registries don't allow add/remove operations.
remove: (name) => boolean;remove: (name) => boolean;Defined in: packages/typescript/ai/src/tool-registry.ts:31
Remove a tool from the registry by name. For frozen registries, this always returns false.
string
The name of the tool to remove
boolean
true if the tool was removed, false if not found or frozen