AgentToolRegistry<C extends AgentToolContext> class final

A set of tools a presentation renders.

where can only remove, so a set derived from a registry never holds a tool the registry does not. An application that wants its surface closed constructs its registry once and derives every other set from it.

Constructors

AgentToolRegistry(List<AgentTool<C>> tools)

Properties

hashCode → int
The hash code for this object.
no setterinherited
names → List<String>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tools → List<AgentTool<C>>
final

Methods

invoke(C context, String name, Map<String, Object?> arguments) → FutureOr<Object?>
Calls the tool name names with arguments — the entry a presentation uses.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
require(String name) → AgentTool<C>
name's tool, or a refusal.
toString() → String
A string representation of this object.
inherited
where(bool test(AgentTool<C>)) → AgentToolRegistry<C>
The subset of this set test keeps — the only way to derive another presentation's set, and one that can only remove.

Operators

operator ==(Object other) → bool
The equality operator.
inherited
operator [](String name) → AgentTool<C>?

Static Methods

refuse(AgentToolContext context, String name, Map<String, Object?> arguments, Object? refusal()) → FutureOr<Object?>
Refuses a call to name with whatever refusal throws, recording the refusal as a call — for a presentation that must turn a call away without running any tool, and must not let it vanish from the trail.