Package ai.mindconnect.adminui.service
Class ToolTestService
java.lang.Object
ai.mindconnect.adminui.service.ToolTestService
One-shot execution of an
AgentTool with admin-supplied JSON
arguments. Powers the "Test" button on the tool-detail page so an
admin can verify a tool's wiring without going through an agent.
Each test runs in a synthetic session (sessionId =
randomUUID(), userId = "admin-test"). Session-scoped tools
(todo_write, workspace_write, …) therefore write into an isolated
scratch session that's never reused — no risk of polluting a real
conversation. The session directory is left on disk for inspection;
the admin can clean it up later if it accumulates.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontest(ai.mindconnect.agent.domain.AgentDefinition agent, ai.mindconnect.agent.tool.AgentTool agentTool, String argumentsJson) ParsesargumentsJsonas aMap<String,Object>and invokes the tool.test(ai.mindconnect.common.Namespace namespace, ai.mindconnect.agent.tool.AgentTool agentTool, String argumentsJson) Namespace-based variant for testing a tool without an agent context — used by the top-level tool catalog, where there is no owning agent.
-
Constructor Details
-
ToolTestService
public ToolTestService(ai.mindconnect.agent.tool.ToolRegistry toolRegistry)
-
-
Method Details
-
test
public ToolTestService.Result test(ai.mindconnect.agent.domain.AgentDefinition agent, ai.mindconnect.agent.tool.AgentTool agentTool, String argumentsJson) ParsesargumentsJsonas aMap<String,Object>and invokes the tool.argumentsJson == null || ""is treated as "no arguments" ({}). Returns the full execution outcome — the UI renders both success and failure shapes from the same record. -
test
public ToolTestService.Result test(ai.mindconnect.common.Namespace namespace, ai.mindconnect.agent.tool.AgentTool agentTool, String argumentsJson) Namespace-based variant for testing a tool without an agent context — used by the top-level tool catalog, where there is no owning agent. The agent is only ever needed for itsNamespace, so this is the real implementation and the agent-based overload delegates here.
-