ToolRegistry
AgentPrism.Core.dllThe tool registry created from AgentPrismToolRegistration entries.
public sealed class ToolRegistry : IToolRegistryInheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”ToolRegistry(IEnumerable<AgentPrismToolRegistration>, IToolAuthorizationHandler, IOptionsMonitor<AgentPrismOptions>, IRunAttributionContext?, ILogger<AuthorizingAIFunction>, ILogger<TimeoutAIFunction>)
Section titled “ ToolRegistry(IEnumerable<AgentPrismToolRegistration>, IToolAuthorizationHandler, IOptionsMonitor<AgentPrismOptions>, IRunAttributionContext?, ILogger<AuthorizingAIFunction>, ILogger<TimeoutAIFunction>)”Initializes a new registry from registrations.
public ToolRegistry(IEnumerable<AgentPrismToolRegistration> registrations, IToolAuthorizationHandler authorizationHandler, IOptionsMonitor<AgentPrismOptions> optionsMonitor, IRunAttributionContext? attribution, ILogger<AuthorizingAIFunction> authorizingLogger, ILogger<TimeoutAIFunction> timeoutLogger)Parameters
Section titled “Parameters”registrations IEnumerable<AgentPrismToolRegistration>
The tool registrations.
authorizationHandler IToolAuthorizationHandler
The authorization policy applied before every server-side call.
optionsMonitor IOptionsMonitor<AgentPrismOptions>
Supplies the installation’s default tool timeout.
attribution IRunAttributionContext?
The run attribution context, or null when none is registered.
authorizingLogger ILogger<AuthorizingAIFunction>
The logger passed to every AuthorizingAIFunction instance.
timeoutLogger ILogger<TimeoutAIFunction>
The logger passed to every TimeoutAIFunction instance.
Exceptions
Section titled “Exceptions”registrations is null.
The same name is registered more than once, or a client-side tool
(one whose body is not an AI.AIFunction) is registered
with requiresApproval: true.
Methods
Section titled “Methods”List()
Section titled “ List()”Returns the definitions of all registered tools, ordered by name.
public IReadOnlyList<ToolDescriptor> List()Returns
Section titled “Returns”The tool definitions.
TryGet(string, out AIFunctionDeclaration?)
Section titled “ TryGet(string, out AIFunctionDeclaration?)”Fetches the tool with the given name.
public bool TryGet(string name, out AIFunctionDeclaration? tool)Parameters
Section titled “Parameters”name string
The tool name. Comparison is case-sensitive.
tool AIFunctionDeclaration?
The tool found.
Returns
Section titled “Returns”true if the tool is registered.
Remarks
Section titled “Remarks”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.