Package net.thevpc.naru.api.registry
Interface NaruTool
public interface NaruTool
A tool that can be called by the agent's reasoning model.
Implementations must be stateless (or thread-safe) — the registry reuses the same instance across calls.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanacceptMode(NaruPromptMode mode) execute(NaruToolCallContext context) Execute the tool and return a string result that will be sent back to the model as a "tool" role message.getDefinition(NaruSession session) Returns the full OpenAI-compatible JSON tool definition.getDescription(NaruSession session) Human-readable description sent to the model.name()Machine-readable name used in the tool schema (no spaces).
-
Method Details
-
name
String name()Machine-readable name used in the tool schema (no spaces). -
getDescription
Human-readable description sent to the model. -
getDefinition
Returns the full OpenAI-compatible JSON tool definition. -
execute
Execute the tool and return a string result that will be sent back to the model as a "tool" role message.- Parameters:
context- per-run context (project dir, session, etc.)- Returns:
- result string (text, JSON snippet, error message, …)
-
acceptMode
-