Package ai.mindconnect.agent.tool
Interface ToolFactory
public interface ToolFactory
SPI for contributing a single built-in tool to the agent runtime.
Each factory is responsible for one tool name. Implementations are
discovered via ServiceLoader. Each tool module ships a
file:
META-INF/services/ai.mindconnect.agent.tool.ToolFactorycontaining the fully-qualified class names of every factory it provides (one per line).
Lifecycle:
- The runtime instantiates each factory via its public no-arg constructor.
bind(ToolEnvironment)is called exactly once with the runtime environment so the factory can capture only the dependencies it needs.isAvailable()is consulted to decide whether the factory can serve requests at all (e.g. a missing API key may disable a tool).create(AgentTool, ToolCallScope)is invoked per tool resolution.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidbind(ToolEnvironment env) Called once after construction to wire the factory against the runtime environment.create(AgentTool agentTool, ToolCallScope scope) Build a tool for the given configuration and call scope.default Stringgroup()Rubric under which this tool is shown in catalogs and pickers (e.g.default booleanWhether this factory has everything it needs to produce a working tool.name()Unique tool name this factory produces (e.g.JSON-Schema-shaped description of the config overrides this tool understands inAgentTool.overrides()— operator-level settings the LLM never sees (e.g.
-
Method Details
-
name
String name()Unique tool name this factory produces (e.g."web_search"). -
group
Rubric under which this tool is shown in catalogs and pickers (e.g."web","documents","files"). Lowercase; UIs capitalize for display. Most built-in names already follow thegroup_nameconvention (e.g.web_search). Default"general". -
bind
Called once after construction to wire the factory against the runtime environment. Default implementation does nothing; override to grab services or configuration fromenv. -
isAvailable
default boolean isAvailable()Whether this factory has everything it needs to produce a working tool. Defaults totrue; override to disable the factory when required configuration is missing. -
overridesSchema
JSON-Schema-shaped description of the config overrides this tool understands inAgentTool.overrides()— operator-level settings the LLM never sees (e.g.baseDirfor file-rooted tools,networkfor code execution). Admin UIs render this so overrides are discoverable instead of doc-only knowledge. The reservedparamsoverride (parameter pinning) is a framework feature and not listed here. Default: no overrides. -
create
Build a tool for the given configuration and call scope.
-