Skip to content

Add ipType for prebuild Cloud SQL configs #877

@iofirag

Description

@iofirag

Prerequisites

  • I've searched the current open issues
  • I've updated to the latest version of Toolbox

Toolbox version

toolbox version 0.9.0+binary.windows.amd64.2b69700c5e40ad37eafd94f378a2e1174879402b

Environment

win 11 terminal (Git Bash)

Client

can't declare ip of type "private" when using the --prebuilt flag.

for example when when add in the tools.yanl
ipType: "private"
and run:
./toolbox.exe --tools-file tools.yaml
it's run

but when run with --prebuilt flag:
./toolbox --prebuilt cloud-sql-mysql
there isnt place to config the ip type to "private"

Expected Behavior

Option 1:

dedicated env variable for declare the ip type, so in that way i can write:
export IP_TYPE="private"

Option 2:

toolbox optional flag:
./toolbox --prebuilt cloud-sql-mysql --ip-type private

Current Behavior

2025-07-13T16:48:08.0980712+03:00 INFO "Using prebuilt tool configuration for cloud-sql-mysql" 
2025-07-13T16:48:10.7851722+03:00 ERROR "toolbox failed to initialize: unable to initialize configs: unable to initialize source \"cloud-sql-mysql-source\": unable to connect successfully: config error: instance does not have IP of type \"PUBLIC\" (connection name = \"finder-development-447112:europe-west2:development-mysql\")" 
Usage:
  toolbox [flags]

Flags:
  -a, --address string                  Address of the interface the server will listen on. (default "127.0.0.1")
      --disable-reload                  Disables dynamic reloading of tools file.
  -h, --help                            help for toolbox
      --log-level stringLevel           Specify the minimum level logged. Allowed: 'DEBUG', 'INFO', 'WARN', 'ERROR'. (default info)
      --logging-format logFormat        Specify logging format to use. Allowed: 'standard' or 'JSON'. (default standard)
  -p, --port int                        Port the server will listen on. (default 5000)
      --prebuilt string                 Use a prebuilt tool configuration by source type. Cannot be used with --tools-file. Allowed: 'alloydb-postgres', 'bigquery', 'cloud-sql-mysql', 'cloud-sql-postgres', 'cloud-sql-mssql', 'postgres', 'spanner', 'spanner-postgres'.
      --stdio                           Listens via MCP STDIO instead of acting as a remote HTTP server.
      --telemetry-gcp                   Enable exporting directly to Google Cloud Monitoring.
      --telemetry-otlp string           Enable exporting using OpenTelemetry Protocol (OTLP) to the specified endpoint (e.g. 'http://127.0.0.1:4318')
      --telemetry-service-name string   Sets the value of the service.name resource attribute for telemetry data. (default "toolbox")       
      --tools-file string               File path specifying the tool configuration. Cannot be used with --prebuilt, --tools-files, or --tools-folder.
      --tools-files strings             Multiple file paths specifying tool configurations. Files will be merged. Cannot be used with --prebuilt, --tools-file, or --tools-folder.
      --tools-folder string             Directory path containing YAML tool configuration files. All .yaml and .yml files in the directory will be loaded and merged. Cannot be used with --prebuilt, --tools-file, or --tools-files.
  -v, --version                         version for toolbox

Steps to reproduce?

run toolbox with prebuilt flag with value of cloud-sql-mysql missing env option for ipType

export CLOUD_SQL_MYSQL_PROJECT=""
export CLOUD_SQL_MYSQL_REGION=""
export CLOUD_SQL_MYSQL_INSTANCE=""
export CLOUD_SQL_MYSQL_DATABASE=""
export CLOUD_SQL_MYSQL_USER=""
export CLOUD_SQL_MYSQL_PASSWORD=""
export GOOGLE_APPLICATION_CREDENTIALS=""

./toolbox --prebuilt cloud-sql-mysql

Additional Details

i dont know if it's a bug or feature request:
#882

No response

Metadata

Metadata

Assignees

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions