Class AliasTool

java.lang.Object
ai.mindconnect.agent.tool.AliasTool
All Implemented Interfaces:
Tool

public final class AliasTool extends Object implements Tool
Lets an agent expose a registry tool under its own name. The override {"tool": "vector_search"} means: resolve THAT factory, but present it to the LLM as this AgentTool's name (and, when set, its description). An agent can therefore carry the same underlying tool twice without collision — e.g. search_project_docs pinned to a knowledge store next to the plain session-scoped vector_search — and the alias name itself documents intent to the model.

Applied by SpiToolRegistry.resolve(ai.mindconnect.agent.tool.AgentTool, ai.mindconnect.common.Namespace, java.lang.String, java.util.UUID) before parameter pinning, so pins reference the underlying tool's real parameter names.

  • Field Details

    • OVERRIDE_KEY

      public static final String OVERRIDE_KEY
      Override key naming the registry tool to resolve instead of the agent-tool name.
      See Also:
  • Method Details

    • registryName

      public static String registryName(AgentTool agentTool)
      The registry name to resolve for this agent tool: alias target, else the tool's own name.
    • wrap

      public static Tool wrap(AgentTool agentTool, Tool delegate)
      Wraps delegate under the agent tool's name when aliased; identity otherwise.
    • name

      public String name()
      Specified by:
      name in interface Tool
    • description

      public String description()
      Specified by:
      description in interface Tool
    • parametersSchema

      public Map<String,Object> parametersSchema()
      Specified by:
      parametersSchema in interface Tool
    • execute

      public String execute(Map<String,Object> arguments)
      Specified by:
      execute in interface Tool
    • streamsResultToUser

      public boolean streamsResultToUser()
      Description copied from interface: Tool
      If true, the tool result is streamed directly to the user before the LLM sees it.
      Specified by:
      streamsResultToUser in interface Tool