Skip to main content

Overview

Methods

getTools()

Get all tools (local + adopted).
Example:

getToolsForListing()

Get tools appropriate for MCP listing with elicitation support filtering.
Example:

getExported()

Lookup a tool by its exported (resolved) name.
Example:

exportResolvedNames()

Produce unique, conflict-aware exported names for all tools.
Example:

getInlineTools()

Get tools defined inline in this registry (local only, not adopted).

listAllInstances()

List all tool instances (locals + adopted).

listByOwner()

List tools by owner path.
Example:

registerToolInstance()

Register a pre-constructed ToolInstance directly.
This is typically used internally for agent-scoped or remote tools.

subscribe()

Subscribe to tool change events.
Returns: Unsubscribe function. Example:

getCapabilities()

Get MCP capabilities for tools.
Example:

hasAny()

Check if any tools exist in the registry.

adoptFromChild()

Adopt tools from a child registry.
References are shared (not cloned). Changes in the child registry automatically propagate to the parent.

Change Events

The registry emits events when tools are added, updated, or removed:

Indexes

The registry maintains O(1) lookup indexes: