This is an overview of tools that can be used in watsonx.ai Flows Using using the wxflows CLI. More tools will be added over time, you can also create a tool for your own data source (Databases; REST, SOAP & GraphQL APIs).
The tools in this directory can be added to your wxflows project using the .ZIP files in this directory. For example, to use the "Wikipedia" tool in your project run the following command:
-
Node.js CLI (experimental)
wxflows import tool https://raw.githubusercontent.com/IBM/wxflows/refs/heads/main/tools/wikipedia.zip
-
Python CLI
wxflows init --endpoint-name api/my-project \ --import-name wikipedia \ --import-package https://raw.githubusercontent.com/IBM/wxflows/refs/heads/main/tools/wikipedia.zip \ --import-tool-name wikipedia \ --import-tool-description "Retrieve information from Wikipedia." \ --import-tool-fields "search|page"
See create your own tool for converting any data source into a tool.
You can edit the tool description after importing:
Python CLI
You can edit the tool definition that was generated in the wxflows.toml file, or register a new tool by creating the tool definition for a new tool in the wxflows.toml file manually:
# wxflows.toml
# ...
[[wxflows.deployment.endpoint.imports]]
name = "my_tool"
directory = "path/to/graphql"
[[wxflows.deployment.endpoint.imports.tools]]
name = "my_tool"
description = """The description for my custom tool"""
fields = "fieldA|fieldB"After editing the wxflows.toml file, run wxflows deploy to make your tools available. See here for more instruction on registering tools using the Python CLI.
Node.js CLI (experimental)
When you generate a GraphQL schema for your data source, a placeholder tool definition will be added to the tools.graphql file in your project. Open the file and uncomment the generated tool definition, or create your own tool definition from scratch. For example:
extend type Query {
my_tool: TC_GraphQL
@supplies(query: "tc_tools")
@materializer(
query: "tc_graphql_tool"
arguments: [
{ name: "name", const: "my_tool" }
{ name: "description", const: "The description for my custom tool" }
{ name: "fields", const: "fieldA|fieldB" }
]
)
}After editing the tools.graphql file, run wxflows deploy to make your tools available. See here for more instruction on registering tools using the Node.js CLI.
Next to using prebuilt tools you can also build your own tool from an existing data source:
If you want to share your tool with others, you need to create a .ZIP file out of your .graphql files. On Macs can do this by running the command:
zip -r mydir.zip mydir
You can share the created .zip file with others or contribute to this repository.
Please reach out to us on Discord if you have any questions or want to share feedback. We'd love to hear from you!