Skip to content

Latest commit

 

History

History
91 lines (57 loc) · 4.87 KB

File metadata and controls

91 lines (57 loc) · 4.87 KB

Client.Tools

Overview

Available Operations

  • list - List available tools
  • run - Execute the specified tool

list

Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned.

Example Usage

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)

Parameters

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.

Response

models.ToolsListResponse

Errors

Error Type Status Code Content Type
errors.GleanError 4XX, 5XX */*

run

Execute the specified tool with provided parameters

Example Usage

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)

Parameters

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.

Response

models.ToolsCallResponse

Errors

Error Type Status Code Content Type
errors.GleanError 4XX, 5XX */*