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 Type
    Method
    Description
    default ToolResult
    beforeApproval(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 String
    callTitle(T input, String name)
    What to call one call of this tool, given what it was called with.
    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.
    Human-readable display name (e.g.
    default String
    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.
    A refusal that holds whatever the input: the user may not use the tool at all.
    default boolean
    Whether this tool opens its own transactions and must run outside the call's.
    default ToolSafety
    Safety classification for approval decisions.
    default boolean
    Whether 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

      Class<T> inputType()
      The input record class. Return Void.class for tools with no input.
    • execute

      ToolResult execute(T input, ToolContext context)
      Execute with the given typed input and agent-scoped context.
    • safety

      default ToolSafety safety()
      Safety classification for approval decisions. Tools default to ToolSafety.WRITE. Override to ToolSafety.READ_ONLY for safe tools that never require approval or ToolSafety.DESTRUCTIVE for 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

      default String callTitle(T input, String name)
      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 none
      name - the tool's configured display name
    • refusal

      default ToolResult.Error 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

      default ToolResult beforeApproval(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. Return an ToolResult.Error to refuse the call without asking, a ToolResult.PendingApproval to 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 none
      context - the call's context
    • provideContext

      default String 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