Package ai.mindconnect.agent.tool
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
Agent-level configuration that the tool implementation may consult. Examples:
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:
baseDirfor file-rooted built-in tools, overriding the runtime defaultcallTimeout,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
ConstructorsConstructorDescriptionAgentTool(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 aAgentToolrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theagentDefinitionIdrecord component.booleandeferred()Returns the value of thedeferredrecord component.Returns the value of thedescriptionrecord component.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of themaxResultCharsrecord component.name()Returns the value of thenamerecord component.booleanReturns the value of theneedsApprovalrecord component.static AgentToolMinimal reference: just a tool name, no overrides, enabled.static AgentToolReference with a human-readable description but no overrides.static AgentToolReference with agent-level overrides (e.g.Returns the value of theoverridesrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aAgentToolrecord class.- Parameters:
id- the value for theidrecord componentagentDefinitionId- the value for theagentDefinitionIdrecord componentname- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentoverrides- the value for theoverridesrecord componentenabled- the value for theenabledrecord componentdeferred- the value for thedeferredrecord componentneedsApproval- the value for theneedsApprovalrecord componentmaxResultChars- the value for themaxResultCharsrecord 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
Minimal reference: just a tool name, no overrides, enabled. -
of
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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
agentDefinitionId
Returns the value of theagentDefinitionIdrecord component.- Returns:
- the value of the
agentDefinitionIdrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
overrides
Returns the value of theoverridesrecord component.- Returns:
- the value of the
overridesrecord component
-
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
deferred
public boolean deferred()Returns the value of thedeferredrecord component.- Returns:
- the value of the
deferredrecord component
-
needsApproval
public boolean needsApproval()Returns the value of theneedsApprovalrecord component.- Returns:
- the value of the
needsApprovalrecord component
-
maxResultChars
Returns the value of themaxResultCharsrecord component.- Returns:
- the value of the
maxResultCharsrecord component
-