Skip to content

IToolRegistry

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The registry of tools registered in code.

public interface IToolRegistry

This registry is one of AgentPrism’s security boundaries. An agent definition can only point to a registered tool by name. Tool code cannot be written from the UI; only a selection is made from registered tools. This keeps anyone with UI access from running code on the server.

Returns the definitions of all registered tools, ordered by name.

IReadOnlyList<ToolDescriptor> List()

IReadOnlyList<ToolDescriptor>

The tool definitions.

TryGet(string, out AIFunctionDeclaration?)

Section titled “ TryGet(string, out AIFunctionDeclaration?)”

Fetches the tool with the given name.

bool TryGet(string name, out AIFunctionDeclaration? tool)

name string

The tool name. Comparison is case-sensitive.

tool AIFunctionDeclaration?

The tool found.

bool

true if the tool is registered.

The result is an AI.AIFunctionDeclaration, not an AI.AIFunction: a client-side tool (AddClientTool) is registered as a declaration-only AIFunctionDeclaration, which is not an AI.AIFunction and cannot be invoked. Every registered tool — server-side or client-side — is an AI.AIFunctionDeclaration, so AIFunctionDeclaration.JsonSchema is always available. Callers pass the result straight to ChatOptions.Tools, which accepts the broader AITool.