Class ToolInvoker
java.lang.Object
com.shaft.commandline.runtime.ToolInvoker
Runs a single tool call end-to-end: routes the connection, parses arguments, renders the result,
and returns a process exit code. This is the shared path behind
call and every curated alias.-
Method Summary
Modifier and TypeMethodDescriptionstatic intinvoke(McpConnector connector, String toolName, ToolOptions options, List<String> keyValues, boolean requiresSession, PrintWriter out, PrintWriter err)
-
Method Details
-
invoke
public static int invoke(McpConnector connector, String toolName, ToolOptions options, List<String> keyValues, boolean requiresSession, PrintWriter out, PrintWriter err) - Parameters:
connector- the connection providertoolName- the MCP tool nameoptions- the shared tool options (--json,--args,--stdio-ok)keyValues- repeatedkey=valueargument tokensrequiresSession- whether the tool needs live browser/device stateout- standard output writererr- standard error writer- Returns:
- the process exit code (0 success, 1 tool/transport error)
-