# ToolRegistry

**Kind:** Class

**Source:** [`atloria-monorepo/libs/agent-core/src/tools/tool-registry.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/tools/tool-registry.ts#L39)

## Methods

| Method | Signature | Returns |
|---|---|---|
| `search` | `search(query: string, maxResults: number)` | `ToolSearchResult[]` |
| `buildDeferredToolsReminder` | `buildDeferredToolsReminder()` | `string` |
| `createToolSearchTool` | `createToolSearchTool()` | `ToolDefinition<any> | null` |
| `get` | `get(name: string)` | `ToolDefinition<any> | undefined` |
| `estimateTokenSavings` | `estimateTokenSavings()` | `{ beforeTokens: number; afterTokens: number; savedTokens: number; savingsPercent: number }` |

## Properties

| Property | Type |
|---|---|
| `alwaysLoaded` | `ToolDefinition<any>[]` |
| `deferred` | `ToolDefinition<any>[]` |

## Where it refuses work

- `ToolRegistry` stops the work with an early return when `this.deferred.length === 0`, in 2 places.
- `ToolRegistry` stops the work with an early return when `keywords.length === 0`.
- `ToolRegistry` stops the work with an early return when `results.length === 0`.
