- list - List available tools
- run - Execute the specified tool
Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.GetRestApiV1ToolsListResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
GetRestApiV1ToolsListResponse res = sdk.client().tools().list()
.call();
if (res.toolsListResponse().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
toolNames |
List<String> |
➖ |
Optional array of tool names to filter by |
GetRestApiV1ToolsListResponse
| Error Type |
Status Code |
Content Type |
| models/errors/APIException |
4XX, 5XX |
*/* |
Execute the specified tool with provided parameters
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.ToolsCallParameter;
import com.glean.api_client.glean_api_client.models.components.ToolsCallRequest;
import com.glean.api_client.glean_api_client.models.operations.PostRestApiV1ToolsCallResponse;
import java.lang.Exception;
import java.util.Map;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
ToolsCallRequest req = ToolsCallRequest.builder()
.name("<value>")
.parameters(Map.ofEntries(
Map.entry("key", ToolsCallParameter.builder()
.name("<value>")
.value("<value>")
.build())))
.build();
PostRestApiV1ToolsCallResponse res = sdk.client().tools().run()
.request(req)
.call();
if (res.toolsCallResponse().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
request |
ToolsCallRequest |
✔️ |
The request object to use for the request. |
PostRestApiV1ToolsCallResponse
| Error Type |
Status Code |
Content Type |
| models/errors/APIException |
4XX, 5XX |
*/* |