docs/en/documentation/configuration/tools/invoke_tool.md
The invoke command allows you to invoke tools defined in your configuration directly from the CLI. This is useful for:
{{< notice tip >}}
Keep configurations minimal: The invoke command initializes all resources (sources, tools, etc.) defined in your configuration files during execution. To ensure fast response times, consider using a minimal configuration file containing only the tools you need for the specific invocation.
{{< /notice >}}
toolbox binary installed or built.tools.yaml).The basic syntax for the command is:
toolbox <tool-source> invoke <tool-name> [params]
<tool-source>: Can be --config, --configs, --config-folder, and --prebuilt. See the CLI Reference for details.<tool-name>: The name of the tool you want to call. This must match the name defined in your tools.yaml.[params]: (Optional) A JSON string representing the arguments for the tool.If your tool takes no parameters, simply provide the tool name:
toolbox --config tools.yaml invoke my-simple-tool
For tools that require arguments, pass them as a JSON string. Ensure you escape quotes correctly for your shell.
Example: A tool that takes parameters
Assuming a tool named mytool taking a and b:
toolbox --config tools.yaml invoke mytool '{"a": 10, "b": 20}'
Example: A tool that queries a database
toolbox --config tools.yaml invoke db-query '{"sql": "SELECT * FROM users LIMIT 5"}'
You can also use the --prebuilt flag to load prebuilt toolsets.
toolbox --prebuilt cloudsql-postgres invoke cloudsql-postgres-list-instances
<tool-name> matches exactly what is in your YAML file and that the file is correctly loaded via --config.invoke command currently does not support flows requiring client-side authorization (like OAuth flow initiation via the CLI). It works best for tools using service-side authentication (e.g., Application Default Credentials).