callTool

suspend fun callTool(name: String, arguments: JsonObject): String

Calls a remote tool and returns its textual result.

Throws

if the server reported isError = true (bad arguments, tool failure) - the message is the server's own text output and can be returned to the model.

on JSON-RPC protocol errors.

on any other transport/protocol failure.