Class RunShellTool

java.lang.Object
net.thevpc.naru.tool.impl.RunShellTool
All Implemented Interfaces:
NaruTool

public class RunShellTool extends Object implements NaruTool
Runs an arbitrary shell command and returns combined stdout+stderr.

Output is capped at 8 KB to avoid flooding the model context.

  • Constructor Details

    • RunShellTool

      public RunShellTool()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: NaruTool
      Machine-readable name used in the tool schema (no spaces).
      Specified by:
      getName in interface NaruTool
    • getDescription

      public String getDescription()
      Description copied from interface: NaruTool
      Human-readable description sent to the model.
      Specified by:
      getDescription in interface NaruTool
    • getDefinition

      public ToolDefinition getDefinition()
      Description copied from interface: NaruTool
      Returns the full OpenAI-compatible JSON tool definition.
      Specified by:
      getDefinition in interface NaruTool
    • execute

      public String execute(Map<String,Object> arguments, AgentContext context)
      Description copied from interface: NaruTool
      Execute the tool and return a string result that will be sent back to the model as a "tool" role message.
      Specified by:
      execute in interface NaruTool
      Parameters:
      arguments - parsed arguments from the model's tool_call
      context - per-run context (project dir, session, etc.)
      Returns:
      result string (text, JSON snippet, error message, …)