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
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 ()) {
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
*/*
retrieveActionPackAuthStatus
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
AuthorizeActionPackResponse
Error Type
Status Code
Content Type
models/errors/APIException
4XX, 5XX
*/*
retrieveToolServerAuthStatus
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
AuthorizeToolServerResponse
Error Type
Status Code
Content Type
models/errors/APIException
4XX, 5XX
*/*