- list - List available tools
- run - Execute the specified tool
- retrieveActionPackAuthStatus - Get end-user authentication status for an action pack.
- authorizeActionPack - Start the OAuth authorization flow for an action pack.
- retrieveToolServerAuthStatus - Get end-user authentication status for a tool server.
- authorizeToolServer - Start the OAuth authorization flow for a tool server.
- getToolServerTools - Get tool definitions from a tool server.
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()) {
System.out.println(res.toolsListResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
toolNames |
List<String> | ➖ | Optional array of tool names to filter by |
| 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()) {
System.out.println(res.toolsCallResponse().get());
}
}
}| 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 | */* |
Reports whether the calling user is already authenticated against the third-party tool backing the specified action pack. Intended for headless / server-driven clients that render an "Authorize" prompt when the user has not yet consented to the tool.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.GetActionPackAuthStatusResponse;
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();
GetActionPackAuthStatusResponse res = sdk.client().tools().retrieveActionPackAuthStatus()
.actionPackId("<id>")
.call();
if (res.actionPackAuthStatusResponse().isPresent()) {
System.out.println(res.actionPackAuthStatusResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
actionPackId |
String | ✔️ | ID of the action pack to query or authorize. |
GetActionPackAuthStatusResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
Starts the third-party OAuth flow for the specified action pack and returns the
redirect URL that the client should navigate the end user to. After the OAuth
callback completes, the user's browser is redirected back to returnUrl with a
status query parameter (?glean_action_auth=success|error&actionPackId=...).
returnUrl must match the tenant's configured return URL allowlist; otherwise the
request is rejected with 400.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.AuthorizeActionPackRequest;
import com.glean.api_client.glean_api_client.models.operations.AuthorizeActionPackResponse;
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();
AuthorizeActionPackResponse res = sdk.client().tools().authorizeActionPack()
.actionPackId("<id>")
.authorizeActionPackRequest(AuthorizeActionPackRequest.builder()
.returnUrl("https://merry-allocation.org/")
.build())
.call();
if (res.authorizeActionPackResponse().isPresent()) {
System.out.println(res.authorizeActionPackResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
actionPackId |
String | ✔️ | ID of the action pack to query or authorize. |
authorizeActionPackRequest |
AuthorizeActionPackRequest | ✔️ | N/A |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
Returns display information and the calling user's current authentication status for the specified tool server.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.GetToolServerAuthStatusResponse;
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();
GetToolServerAuthStatusResponse res = sdk.client().tools().retrieveToolServerAuthStatus()
.serverId("<id>")
.call();
if (res.toolServerAuthStatusResponse().isPresent()) {
System.out.println(res.toolServerAuthStatusResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
serverId |
String | ✔️ | Unique identifier of the tool server. |
GetToolServerAuthStatusResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
Initiates the third-party OAuth flow for the specified tool server and returns the
authorization URL that the client should navigate the end user to. After the OAuth
callback completes, the user's browser is redirected back to returnUrl with query
parameters indicating the result.
returnUrl must match the tenant's configured return URL allowlist; otherwise the
request is rejected with 400.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.components.AuthorizeToolServerRequest;
import com.glean.api_client.glean_api_client.models.operations.AuthorizeToolServerResponse;
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();
AuthorizeToolServerResponse res = sdk.client().tools().authorizeToolServer()
.serverId("<id>")
.authorizeToolServerRequest(AuthorizeToolServerRequest.builder()
.returnUrl("https://lucky-disadvantage.com")
.build())
.call();
if (res.authorizeToolServerResponse().isPresent()) {
System.out.println(res.authorizeToolServerResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
serverId |
String | ✔️ | Unique identifier of the tool server. |
authorizeToolServerRequest |
AuthorizeToolServerRequest | ✔️ | N/A |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
Returns the name, description and JSON input schema for the named tools on the specified tool server. Works for both action packs and MCP servers.
toolNames is required. Names that do not exist on the server are returned in
notFound rather than failing the request, so a single bad name does not force
callers into one-at-a-time retries. Matching is case-insensitive and treats -
and _ as equivalent.
Native tools are not served; serverId=native returns 404.
package hello.world;
import com.glean.api_client.glean_api_client.Glean;
import com.glean.api_client.glean_api_client.models.operations.GetToolServerToolsResponse;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Exception {
Glean sdk = Glean.builder()
.apiToken(System.getenv().getOrDefault("GLEAN_API_TOKEN", ""))
.build();
GetToolServerToolsResponse res = sdk.client().tools().getToolServerTools()
.serverId("<id>")
.toolNames(List.of(
"<value 1>",
"<value 2>",
"<value 3>"))
.call();
if (res.toolDefinitionsResponse().isPresent()) {
System.out.println(res.toolDefinitionsResponse().get());
}
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
serverId |
String | ✔️ | Unique identifier of the tool server. |
toolNames |
List<String> | ✔️ | Tool names to look up on this server. Maximum 100. |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |