Record Class AgentTool

java.lang.Object
java.lang.Record
ai.mindconnect.agent.tool.AgentTool

public record AgentTool(UUID id, UUID agentDefinitionId, String name, String description, Map<String,Object> overrides, boolean enabled, boolean deferred, boolean needsApproval, Integer maxResultChars) extends Record
Reference from an AgentDefinition to a tool the agent is allowed to use.

An AgentTool is intentionally a thin pointer: it carries only the tool's global name plus optional agent-specific overrides. It does not encode where the tool comes from (built-in, MCP, workflow, …) — that's the job of the tool registry/resolver.

overrides()

Agent-level configuration that the tool implementation may consult. Examples:
  • baseDir for file-rooted built-in tools, overriding the runtime default
  • callTimeout, requireConfirmation (planned, not yet read in v0)

The legacy fields toolType, toolConfig and inputSchema have been removed. Older persisted JSON containing those keys is tolerated via JsonIgnoreProperties so existing agent files keep loading.

  • Constructor Summary

    Constructors
    Constructor
    Description
    AgentTool(UUID id, UUID agentDefinitionId, String name, String description, Map<String,Object> overrides, boolean enabled)
    Pre-deferred-flag constructor: tool is always offered (deferred = false).
    AgentTool(UUID id, UUID agentDefinitionId, String name, String description, Map<String,Object> overrides, boolean enabled, boolean deferred)
    Pre-needsApproval constructor: the tool runs unasked.
    AgentTool(UUID id, UUID agentDefinitionId, String name, String description, Map<String,Object> overrides, boolean enabled, boolean deferred, boolean needsApproval)
    Pre-maxResultChars constructor: no per-tool result cap.
    AgentTool(UUID id, UUID agentDefinitionId, String name, String description, Map<String,Object> overrides, boolean enabled, boolean deferred, boolean needsApproval, Integer maxResultChars)
    Creates an instance of a AgentTool record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the agentDefinitionId record component.
    boolean
    Returns the value of the deferred record component.
    Returns the value of the description record component.
    boolean
    Returns the value of the enabled record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    id()
    Returns the value of the id record component.
    Returns the value of the maxResultChars record component.
    Returns the value of the name record component.
    boolean
    Returns the value of the needsApproval record component.
    static AgentTool
    of(UUID agentDefinitionId, String name)
    Minimal reference: just a tool name, no overrides, enabled.
    static AgentTool
    of(UUID agentDefinitionId, String name, String description)
    Reference with a human-readable description but no overrides.
    static AgentTool
    of(UUID agentDefinitionId, String name, String description, Map<String,Object> overrides)
    Reference with agent-level overrides (e.g.
    Returns the value of the overrides record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AgentTool

      public AgentTool(UUID id, UUID agentDefinitionId, String name, String description, Map<String,Object> overrides, boolean enabled, boolean deferred, boolean needsApproval, Integer maxResultChars)
      Creates an instance of a AgentTool record class.
      Parameters:
      id - the value for the id record component
      agentDefinitionId - the value for the agentDefinitionId record component
      name - the value for the name record component
      description - the value for the description record component
      overrides - the value for the overrides record component
      enabled - the value for the enabled record component
      deferred - the value for the deferred record component
      needsApproval - the value for the needsApproval record component
      maxResultChars - the value for the maxResultChars record component
    • AgentTool

      public AgentTool(UUID id, UUID agentDefinitionId, String name, String description, Map<String,Object> overrides, boolean enabled, boolean deferred, boolean needsApproval)
      Pre-maxResultChars constructor: no per-tool result cap.
    • AgentTool

      public AgentTool(UUID id, UUID agentDefinitionId, String name, String description, Map<String,Object> overrides, boolean enabled, boolean deferred)
      Pre-needsApproval constructor: the tool runs unasked.
    • AgentTool

      public AgentTool(UUID id, UUID agentDefinitionId, String name, String description, Map<String,Object> overrides, boolean enabled)
      Pre-deferred-flag constructor: tool is always offered (deferred = false).
  • Method Details

    • of

      public static AgentTool of(UUID agentDefinitionId, String name)
      Minimal reference: just a tool name, no overrides, enabled.
    • of

      public static AgentTool of(UUID agentDefinitionId, String name, String description)
      Reference with a human-readable description but no overrides.
    • of

      public static AgentTool of(UUID agentDefinitionId, String name, String description, Map<String,Object> overrides)
      Reference with agent-level overrides (e.g. baseDir).
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • agentDefinitionId

      public UUID agentDefinitionId()
      Returns the value of the agentDefinitionId record component.
      Returns:
      the value of the agentDefinitionId record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • overrides

      public Map<String,Object> overrides()
      Returns the value of the overrides record component.
      Returns:
      the value of the overrides record component
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • deferred

      public boolean deferred()
      Returns the value of the deferred record component.
      Returns:
      the value of the deferred record component
    • needsApproval

      public boolean needsApproval()
      Returns the value of the needsApproval record component.
      Returns:
      the value of the needsApproval record component
    • maxResultChars

      public Integer maxResultChars()
      Returns the value of the maxResultChars record component.
      Returns:
      the value of the maxResultChars record component