Skip to content

Class: ToolRegistry

Makaio Framework


Makaio Framework / services-core / ToolRegistry

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:57

Central registry for tools and toolsets. Manages registration, lookup, and execution with bus integration. Emits lifecycle events (registered, started, completed, error) for observability. Emits registryChanged with a monotonically increasing revision whenever the set of registered toolsets changes, allowing consumers to invalidate stale tool lists.

new ToolRegistry(options?): ToolRegistry

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:70

Creates a new ToolRegistry with optional configuration.

ToolRegistryOptions

Registry configuration options

ToolRegistry

deregister(toolsetName): Promise<void>

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:166

Deregisters a toolset and all its tools. Emits tool.registryChanged event.

string

Name of the toolset to deregister

Promise<void>

Error if the toolset is not registered


destroy(): void

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:500

Destroy this registry — alias for dispose to satisfy the package service lifecycle contract.

void


dispose(): void

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:489

Cleans up registry resources. Unsubscribes all bus handlers.

void


execute(toolName, input, options?): Promise<ToolResult<unknown>>

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:211

Executes a tool by name with the given input.

Validates input against the tool’s schema, enforces policy, executes the tool, and emits lifecycle events (started, completed/error). Constraints are enriched with file access rules before the tool receives its context.

string

Name of the tool to execute

unknown

Input data (validated against tool’s inputSchema)

ExecuteOptions

Optional execution options (context overrides, adapter identity)

Promise<ToolResult<unknown>>

Tool execution result (success with data or failure with error)


getTool(name): AnyToolDefinition | undefined

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:477

Gets a tool definition by name.

string

Tool name to look up

AnyToolDefinition | undefined

Tool definition or undefined if not found


getToolset(name): Toolset<Record<string, AnyToolDefinition>> | undefined

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:485

Gets a toolset by name.

string

Toolset name to look up

Toolset<Record<string, AnyToolDefinition>> | undefined

Toolset or undefined if not found


listTools(filter?): ToolInfo[]

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:390

Lists all registered tools with optional filtering.

ListToolsFilter

Optional filter criteria

ToolInfo[]

Array of tool information


listToolsets(): ToolsetInfo[]

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:421

Lists all registered toolsets with metadata including configSchema as JSON Schema.

ToolsetInfo[]

Array of toolset information


listToolsWithToolsets(filter?): Promise<ToolsWithToolsetsResult>

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:449

Lists tools and toolsets with optional filtering. Applies policy filtering when adapterName is provided.

ListToolsFilter

Optional filter criteria

Promise<ToolsWithToolsetsResult>

Object containing tools array and toolsets array


register(toolset): Promise<void>

Defined in: ../../../packages/services/core/src/tools/tool-registry.ts:114

Registers a toolset. All tools are indexed by name. Emits tool.registered event.

Toolset

Toolset to register

Promise<void>