Class WriteFileTool

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

public class WriteFileTool extends Object implements NaruTool
Writes (or overwrites) a file on disk.
  • Constructor Details

    • WriteFileTool

      public WriteFileTool()
  • 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, …)