- 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.
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.client.tools.list()
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
tool_names |
List[str] |
➖ |
Optional array of tool names to filter by |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ToolsListResponse
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |
Execute the specified tool with provided parameters
from glean.api_client import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as glean:
res = glean.client.tools.run(name="<value>", parameters={
})
# Handle response
print(res)
| Parameter |
Type |
Required |
Description |
name |
str |
✔️ |
Required name of the tool to execute |
parameters |
Dict[str, models.ToolsCallParameter] |
✔️ |
The parameters for the tool. Each key is the name of the parameter and the value is the parameter object. |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ToolsCallResponse
| Error Type |
Status Code |
Content Type |
| errors.GleanError |
4XX, 5XX |
*/* |