Skip to content

agent-tools / Exports / ToolRegistry

Class: ToolRegistry

Tool registry implementation Manages tool registration, validation, and retrieval

Implements

  • IToolRegistry

Table of contents

Constructors

Methods

Constructors

constructor

new ToolRegistry(): ToolRegistry

Returns

ToolRegistry

Methods

register

register(tool): void

Register a tool

Parameters

NameType
toolITool

Returns

void

Implementation of

IToolRegistry.register

Defined in

packages/agent-tools/src/registry/tool-registry.ts:16


unregister

unregister(name): void

Unregister a tool

Parameters

NameType
namestring

Returns

void

Implementation of

IToolRegistry.unregister

Defined in

packages/agent-tools/src/registry/tool-registry.ts:45


get

get(name): undefined | ITool

Get tool by name

Parameters

NameType
namestring

Returns

undefined | ITool

Implementation of

IToolRegistry.get

Defined in

packages/agent-tools/src/registry/tool-registry.ts:58


getAll

getAll(): ITool[]

Get all registered tools

Returns

ITool[]

Implementation of

IToolRegistry.getAll

Defined in

packages/agent-tools/src/registry/tool-registry.ts:65


getSchemas

getSchemas(): IToolSchema[]

Get tool schemas

Returns

IToolSchema[]

Implementation of

IToolRegistry.getSchemas

Defined in

packages/agent-tools/src/registry/tool-registry.ts:72


has

has(name): boolean

Check if tool exists

Parameters

NameType
namestring

Returns

boolean

Implementation of

IToolRegistry.has

Defined in

packages/agent-tools/src/registry/tool-registry.ts:92


clear

clear(): void

Clear all tools

Returns

void

Implementation of

IToolRegistry.clear

Defined in

packages/agent-tools/src/registry/tool-registry.ts:99


getToolNames

getToolNames(): string[]

Get tool names

Returns

string[]

Defined in

packages/agent-tools/src/registry/tool-registry.ts:108


getToolsByPattern

getToolsByPattern(pattern): ITool[]

Get tools by pattern

Parameters

NameType
patternstring | RegExp

Returns

ITool[]

Defined in

packages/agent-tools/src/registry/tool-registry.ts:115


size

size(): number

Get tool count

Returns

number

Defined in

packages/agent-tools/src/registry/tool-registry.ts:123

Released under the MIT License.