Package com.axelor.ai.tool.system
Interface SystemTool<T>
- All Known Subinterfaces:
StudioSystemTool<T>
- All Known Implementing Classes:
CreateRecordTool,CurrentUserTool,DeleteRecordTool,DescribeModelTool,InspectAiConfigTool,InspectProcessTool,ListModelsTool,ModelAwareSystemTool,QueryRecordsTool,ReadActivityTool,ReadRecordTool,ResolveViewTool,RunProcedureTool,SaveAgentTool,SaveQueryTool,SaveSkillTool,SaveToolTool,SearchKnowledgeTool,SearchRecordsTool,ShowDataTool,StudioCheckAppTool,StudioCreateVersionTool,StudioDeleteResourcesTool,StudioDeployAppTool,StudioInitViewTool,StudioListResourcesTool,StudioPublishAppTool,StudioSaveActionTool,StudioSaveAppTool,StudioSaveEntityTool,StudioSaveEnumTool,StudioSaveFieldTool,StudioSaveMenuTool,StudioSaveModelTool,StudioSaveQueryTool,StudioSaveSelectionTool,StudioSaveTranslationTool,StudioSaveViewTool,StudioSaveWorkflowTool,StudioUndeployAppTool,TryAgentTool,UpdateRecordTool,UseSkillTool
public interface SystemTool<T>
Extensible system tool registered via Guice Multibinder.
What a person reads is translated: the tool's name, a call's title and an approval card's note. What only the model reads — a refusal, an error, a hint on how to call it right — is plain English: it is no help to a person, and a translation could garble the input it spells out.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ToolResultbeforeApproval(T input, ToolContext context) Looked at before the user is asked to approve a call, for a tool that needs approval: a refusal known up front should not cost the user a decision.default StringWhat to call one call of this tool, given what it was called with.code()Unique code matching AiTool.systemTool field.Brief description of what this tool does.execute(T input, ToolContext context) Execute with the given typed input and agent-scoped context.The input record class.name()Human-readable display name (e.g.default StringProvides context text to inject into the system prompt at request time, avoiding the need for the LLM to call this tool just to learn the current state.default ToolResult.Errorrefusal()A refusal that holds whatever the input: the user may not use the tool at all.default booleanWhether this tool opens its own transactions and must run outside the call's.default ToolSafetysafety()Safety classification for approval decisions.default booleanWhether rolling back the call's transaction undoes all it did.
-
Method Details
-
code
String code()Unique code matching AiTool.systemTool field. -
name
String name()Human-readable display name (e.g. "Search Records"). -
description
String description()Brief description of what this tool does. -
inputType
The input record class. ReturnVoid.classfor tools with no input. -
execute
Execute with the given typed input and agent-scoped context. -
safety
Safety classification for approval decisions. Tools default toToolSafety.WRITE. Override toToolSafety.READ_ONLYfor safe tools that never require approval orToolSafety.DESTRUCTIVEfor tools that should always require approval. -
runsOutsideTransaction
default boolean runsOutsideTransaction()Whether this tool opens its own transactions and must run outside the call's. A tool whose work is several steps, each to be committed on its own as a browser commits each request, returns true; every other tool keeps the one transaction that makes its writes atomic. -
undoneByRollback
default boolean undoneByRollback()Whether rolling back the call's transaction undoes all it did. A tool that also changes what lives outside the database, such as a cache or a registry of what is deployed, returns false, and a trial run does not run it. -
callTitle
What to call one call of this tool, given what it was called with.One call of a tool is not like the next: a tool that takes one record or several cannot be named accurately by its configuration alone. The name it is configured with is passed in, and returning it — as the default does — is what leaves the tool named the way the administrator named it.
- Parameters:
input- the call's input, or null when the tool takes nonename- the tool's configured display name
-
refusal
A refusal that holds whatever the input: the user may not use the tool at all. Asked before the user is asked to approve a call, and again before the call runs; null to let it go on. -
beforeApproval
Looked at before the user is asked to approve a call, for a tool that needs approval: a refusal known up front should not cost the user a decision. Return anToolResult.Errorto refuse the call without asking, aToolResult.PendingApprovalto ask with what its card should show, or null to ask as usual. The call itself checks again when it runs.- Parameters:
input- the call's input, or null when the tool takes nonecontext- the call's context
-
provideContext
Provides context text to inject into the system prompt at request time, avoiding the need for the LLM to call this tool just to learn the current state.Called automatically for each tool assigned to the agent before the LLM runs. Return
null(the default) if this tool has no context to provide.- Returns:
- context text to append to the system prompt, or null
-