This is page 2 of 45. Use http://codebase.md/googleapis/genai-toolbox?lines=true&page={x} to view the full context. # Directory Structure ``` ├── .ci │ ├── continuous.release.cloudbuild.yaml │ ├── generate_release_table.sh │ ├── integration.cloudbuild.yaml │ ├── quickstart_test │ │ ├── go.integration.cloudbuild.yaml │ │ ├── js.integration.cloudbuild.yaml │ │ ├── py.integration.cloudbuild.yaml │ │ ├── run_go_tests.sh │ │ ├── run_js_tests.sh │ │ ├── run_py_tests.sh │ │ └── setup_hotels_sample.sql │ ├── test_with_coverage.sh │ └── versioned.release.cloudbuild.yaml ├── .github │ ├── auto-label.yaml │ ├── blunderbuss.yml │ ├── CODEOWNERS │ ├── header-checker-lint.yml │ ├── ISSUE_TEMPLATE │ │ ├── bug_report.yml │ │ ├── config.yml │ │ ├── feature_request.yml │ │ └── question.yml │ ├── label-sync.yml │ ├── labels.yaml │ ├── PULL_REQUEST_TEMPLATE.md │ ├── release-please.yml │ ├── renovate.json5 │ ├── sync-repo-settings.yaml │ └── workflows │ ├── cloud_build_failure_reporter.yml │ ├── deploy_dev_docs.yaml │ ├── deploy_previous_version_docs.yaml │ ├── deploy_versioned_docs.yaml │ ├── docs_deploy.yaml │ ├── docs_preview_clean.yaml │ ├── docs_preview_deploy.yaml │ ├── lint.yaml │ ├── schedule_reporter.yml │ ├── sync-labels.yaml │ └── tests.yaml ├── .gitignore ├── .gitmodules ├── .golangci.yaml ├── .hugo │ ├── archetypes │ │ └── default.md │ ├── assets │ │ ├── icons │ │ │ └── logo.svg │ │ └── scss │ │ ├── _styles_project.scss │ │ └── _variables_project.scss │ ├── go.mod │ ├── go.sum │ ├── hugo.toml │ ├── layouts │ │ ├── _default │ │ │ └── home.releases.releases │ │ ├── index.llms-full.txt │ │ ├── index.llms.txt │ │ ├── partials │ │ │ ├── hooks │ │ │ │ └── head-end.html │ │ │ ├── navbar-version-selector.html │ │ │ ├── page-meta-links.html │ │ │ └── td │ │ │ └── render-heading.html │ │ ├── robot.txt │ │ └── shortcodes │ │ ├── include.html │ │ ├── ipynb.html │ │ └── regionInclude.html │ ├── package-lock.json │ ├── package.json │ └── static │ ├── favicons │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ └── favicon.ico │ └── js │ └── w3.js ├── CHANGELOG.md ├── cmd │ ├── options_test.go │ ├── options.go │ ├── root_test.go │ ├── root.go │ └── version.txt ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DEVELOPER.md ├── Dockerfile ├── docs │ └── en │ ├── _index.md │ ├── about │ │ ├── _index.md │ │ └── faq.md │ ├── concepts │ │ ├── _index.md │ │ └── telemetry │ │ ├── index.md │ │ ├── telemetry_flow.png │ │ └── telemetry_traces.png │ ├── getting-started │ │ ├── _index.md │ │ ├── colab_quickstart.ipynb │ │ ├── configure.md │ │ ├── introduction │ │ │ ├── _index.md │ │ │ └── architecture.png │ │ ├── local_quickstart_go.md │ │ ├── local_quickstart_js.md │ │ ├── local_quickstart.md │ │ ├── mcp_quickstart │ │ │ ├── _index.md │ │ │ ├── inspector_tools.png │ │ │ └── inspector.png │ │ └── quickstart │ │ ├── go │ │ │ ├── genAI │ │ │ │ ├── go.mod │ │ │ │ ├── go.sum │ │ │ │ └── quickstart.go │ │ │ ├── genkit │ │ │ │ ├── go.mod │ │ │ │ ├── go.sum │ │ │ │ └── quickstart.go │ │ │ ├── langchain │ │ │ │ ├── go.mod │ │ │ │ ├── go.sum │ │ │ │ └── quickstart.go │ │ │ ├── openAI │ │ │ │ ├── go.mod │ │ │ │ ├── go.sum │ │ │ │ └── quickstart.go │ │ │ └── quickstart_test.go │ │ ├── golden.txt │ │ ├── js │ │ │ ├── genAI │ │ │ │ ├── package-lock.json │ │ │ │ ├── package.json │ │ │ │ └── quickstart.js │ │ │ ├── genkit │ │ │ │ ├── package-lock.json │ │ │ │ ├── package.json │ │ │ │ └── quickstart.js │ │ │ ├── langchain │ │ │ │ ├── package-lock.json │ │ │ │ ├── package.json │ │ │ │ └── quickstart.js │ │ │ ├── llamaindex │ │ │ │ ├── package-lock.json │ │ │ │ ├── package.json │ │ │ │ └── quickstart.js │ │ │ └── quickstart.test.js │ │ ├── python │ │ │ ├── __init__.py │ │ │ ├── adk │ │ │ │ ├── quickstart.py │ │ │ │ └── requirements.txt │ │ │ ├── core │ │ │ │ ├── quickstart.py │ │ │ │ └── requirements.txt │ │ │ ├── langchain │ │ │ │ ├── quickstart.py │ │ │ │ └── requirements.txt │ │ │ ├── llamaindex │ │ │ │ ├── quickstart.py │ │ │ │ └── requirements.txt │ │ │ └── quickstart_test.py │ │ └── shared │ │ ├── cloud_setup.md │ │ ├── configure_toolbox.md │ │ └── database_setup.md │ ├── how-to │ │ ├── _index.md │ │ ├── connect_via_geminicli.md │ │ ├── connect_via_mcp.md │ │ ├── connect-ide │ │ │ ├── _index.md │ │ │ ├── alloydb_pg_admin_mcp.md │ │ │ ├── alloydb_pg_mcp.md │ │ │ ├── bigquery_mcp.md │ │ │ ├── cloud_sql_mssql_admin_mcp.md │ │ │ ├── cloud_sql_mssql_mcp.md │ │ │ ├── cloud_sql_mysql_admin_mcp.md │ │ │ ├── cloud_sql_mysql_mcp.md │ │ │ ├── cloud_sql_pg_admin_mcp.md │ │ │ ├── cloud_sql_pg_mcp.md │ │ │ ├── firestore_mcp.md │ │ │ ├── looker_mcp.md │ │ │ ├── mssql_mcp.md │ │ │ ├── mysql_mcp.md │ │ │ ├── neo4j_mcp.md │ │ │ ├── postgres_mcp.md │ │ │ ├── spanner_mcp.md │ │ │ └── sqlite_mcp.md │ │ ├── deploy_docker.md │ │ ├── deploy_gke.md │ │ ├── deploy_toolbox.md │ │ ├── export_telemetry.md │ │ └── toolbox-ui │ │ ├── edit-headers.gif │ │ ├── edit-headers.png │ │ ├── index.md │ │ ├── optional-param-checked.png │ │ ├── optional-param-unchecked.png │ │ ├── run-tool.gif │ │ ├── tools.png │ │ └── toolsets.png │ ├── reference │ │ ├── _index.md │ │ ├── cli.md │ │ └── prebuilt-tools.md │ ├── resources │ │ ├── _index.md │ │ ├── authServices │ │ │ ├── _index.md │ │ │ └── google.md │ │ ├── sources │ │ │ ├── _index.md │ │ │ ├── alloydb-admin.md │ │ │ ├── alloydb-pg.md │ │ │ ├── bigquery.md │ │ │ ├── bigtable.md │ │ │ ├── cassandra.md │ │ │ ├── clickhouse.md │ │ │ ├── cloud-monitoring.md │ │ │ ├── cloud-sql-admin.md │ │ │ ├── cloud-sql-mssql.md │ │ │ ├── cloud-sql-mysql.md │ │ │ ├── cloud-sql-pg.md │ │ │ ├── couchbase.md │ │ │ ├── dataplex.md │ │ │ ├── dgraph.md │ │ │ ├── firebird.md │ │ │ ├── firestore.md │ │ │ ├── http.md │ │ │ ├── looker.md │ │ │ ├── mongodb.md │ │ │ ├── mssql.md │ │ │ ├── mysql.md │ │ │ ├── neo4j.md │ │ │ ├── oceanbase.md │ │ │ ├── oracle.md │ │ │ ├── postgres.md │ │ │ ├── redis.md │ │ │ ├── spanner.md │ │ │ ├── sqlite.md │ │ │ ├── tidb.md │ │ │ ├── trino.md │ │ │ ├── valkey.md │ │ │ └── yugabytedb.md │ │ └── tools │ │ ├── _index.md │ │ ├── alloydb │ │ │ ├── _index.md │ │ │ ├── alloydb-create-cluster.md │ │ │ ├── alloydb-create-instance.md │ │ │ ├── alloydb-create-user.md │ │ │ ├── alloydb-get-cluster.md │ │ │ ├── alloydb-get-instance.md │ │ │ ├── alloydb-get-user.md │ │ │ ├── alloydb-list-clusters.md │ │ │ ├── alloydb-list-instances.md │ │ │ ├── alloydb-list-users.md │ │ │ └── alloydb-wait-for-operation.md │ │ ├── alloydbainl │ │ │ ├── _index.md │ │ │ └── alloydb-ai-nl.md │ │ ├── bigquery │ │ │ ├── _index.md │ │ │ ├── bigquery-analyze-contribution.md │ │ │ ├── bigquery-conversational-analytics.md │ │ │ ├── bigquery-execute-sql.md │ │ │ ├── bigquery-forecast.md │ │ │ ├── bigquery-get-dataset-info.md │ │ │ ├── bigquery-get-table-info.md │ │ │ ├── bigquery-list-dataset-ids.md │ │ │ ├── bigquery-list-table-ids.md │ │ │ ├── bigquery-search-catalog.md │ │ │ └── bigquery-sql.md │ │ ├── bigtable │ │ │ ├── _index.md │ │ │ └── bigtable-sql.md │ │ ├── cassandra │ │ │ ├── _index.md │ │ │ └── cassandra-cql.md │ │ ├── clickhouse │ │ │ ├── _index.md │ │ │ ├── clickhouse-execute-sql.md │ │ │ ├── clickhouse-list-databases.md │ │ │ ├── clickhouse-list-tables.md │ │ │ └── clickhouse-sql.md │ │ ├── cloudmonitoring │ │ │ ├── _index.md │ │ │ └── cloud-monitoring-query-prometheus.md │ │ ├── cloudsql │ │ │ ├── _index.md │ │ │ ├── cloudsqlcreatedatabase.md │ │ │ ├── cloudsqlcreateusers.md │ │ │ ├── cloudsqlgetinstances.md │ │ │ ├── cloudsqllistdatabases.md │ │ │ ├── cloudsqllistinstances.md │ │ │ ├── cloudsqlmssqlcreateinstance.md │ │ │ ├── cloudsqlmysqlcreateinstance.md │ │ │ ├── cloudsqlpgcreateinstances.md │ │ │ └── cloudsqlwaitforoperation.md │ │ ├── couchbase │ │ │ ├── _index.md │ │ │ └── couchbase-sql.md │ │ ├── dataform │ │ │ ├── _index.md │ │ │ └── dataform-compile-local.md │ │ ├── dataplex │ │ │ ├── _index.md │ │ │ ├── dataplex-lookup-entry.md │ │ │ ├── dataplex-search-aspect-types.md │ │ │ └── dataplex-search-entries.md │ │ ├── dgraph │ │ │ ├── _index.md │ │ │ └── dgraph-dql.md │ │ ├── firebird │ │ │ ├── _index.md │ │ │ ├── firebird-execute-sql.md │ │ │ └── firebird-sql.md │ │ ├── firestore │ │ │ ├── _index.md │ │ │ ├── firestore-add-documents.md │ │ │ ├── firestore-delete-documents.md │ │ │ ├── firestore-get-documents.md │ │ │ ├── firestore-get-rules.md │ │ │ ├── firestore-list-collections.md │ │ │ ├── firestore-query-collection.md │ │ │ ├── firestore-query.md │ │ │ ├── firestore-update-document.md │ │ │ └── firestore-validate-rules.md │ │ ├── http │ │ │ ├── _index.md │ │ │ └── http.md │ │ ├── looker │ │ │ ├── _index.md │ │ │ ├── looker-add-dashboard-element.md │ │ │ ├── looker-conversational-analytics.md │ │ │ ├── looker-get-dashboards.md │ │ │ ├── looker-get-dimensions.md │ │ │ ├── looker-get-explores.md │ │ │ ├── looker-get-filters.md │ │ │ ├── looker-get-looks.md │ │ │ ├── looker-get-measures.md │ │ │ ├── looker-get-models.md │ │ │ ├── looker-get-parameters.md │ │ │ ├── looker-health-analyze.md │ │ │ ├── looker-health-pulse.md │ │ │ ├── looker-health-vacuum.md │ │ │ ├── looker-make-dashboard.md │ │ │ ├── looker-make-look.md │ │ │ ├── looker-query-sql.md │ │ │ ├── looker-query-url.md │ │ │ ├── looker-query.md │ │ │ └── looker-run-look.md │ │ ├── mongodb │ │ │ ├── _index.md │ │ │ ├── mongodb-aggregate.md │ │ │ ├── mongodb-delete-many.md │ │ │ ├── mongodb-delete-one.md │ │ │ ├── mongodb-find-one.md │ │ │ ├── mongodb-find.md │ │ │ ├── mongodb-insert-many.md │ │ │ ├── mongodb-insert-one.md │ │ │ ├── mongodb-update-many.md │ │ │ └── mongodb-update-one.md │ │ ├── mssql │ │ │ ├── _index.md │ │ │ ├── mssql-execute-sql.md │ │ │ ├── mssql-list-tables.md │ │ │ └── mssql-sql.md │ │ ├── mysql │ │ │ ├── _index.md │ │ │ ├── mysql-execute-sql.md │ │ │ ├── mysql-list-active-queries.md │ │ │ ├── mysql-list-table-fragmentation.md │ │ │ ├── mysql-list-tables-missing-unique-indexes.md │ │ │ ├── mysql-list-tables.md │ │ │ └── mysql-sql.md │ │ ├── neo4j │ │ │ ├── _index.md │ │ │ ├── neo4j-cypher.md │ │ │ ├── neo4j-execute-cypher.md │ │ │ └── neo4j-schema.md │ │ ├── oceanbase │ │ │ ├── _index.md │ │ │ ├── oceanbase-execute-sql.md │ │ │ └── oceanbase-sql.md │ │ ├── oracle │ │ │ ├── _index.md │ │ │ ├── oracle-execute-sql.md │ │ │ └── oracle-sql.md │ │ ├── postgres │ │ │ ├── _index.md │ │ │ ├── postgres-execute-sql.md │ │ │ ├── postgres-list-active-queries.md │ │ │ ├── postgres-list-available-extensions.md │ │ │ ├── postgres-list-installed-extensions.md │ │ │ ├── postgres-list-tables.md │ │ │ └── postgres-sql.md │ │ ├── redis │ │ │ ├── _index.md │ │ │ └── redis.md │ │ ├── spanner │ │ │ ├── _index.md │ │ │ ├── spanner-execute-sql.md │ │ │ ├── spanner-list-tables.md │ │ │ └── spanner-sql.md │ │ ├── sqlite │ │ │ ├── _index.md │ │ │ ├── sqlite-execute-sql.md │ │ │ └── sqlite-sql.md │ │ ├── tidb │ │ │ ├── _index.md │ │ │ ├── tidb-execute-sql.md │ │ │ └── tidb-sql.md │ │ ├── trino │ │ │ ├── _index.md │ │ │ ├── trino-execute-sql.md │ │ │ └── trino-sql.md │ │ ├── utility │ │ │ ├── _index.md │ │ │ └── wait.md │ │ ├── valkey │ │ │ ├── _index.md │ │ │ └── valkey.md │ │ └── yuagbytedb │ │ ├── _index.md │ │ └── yugabytedb-sql.md │ ├── samples │ │ ├── _index.md │ │ ├── alloydb │ │ │ ├── _index.md │ │ │ ├── ai-nl │ │ │ │ ├── alloydb_ai_nl.ipynb │ │ │ │ └── index.md │ │ │ └── mcp_quickstart.md │ │ ├── bigquery │ │ │ ├── _index.md │ │ │ ├── colab_quickstart_bigquery.ipynb │ │ │ ├── local_quickstart.md │ │ │ └── mcp_quickstart │ │ │ ├── _index.md │ │ │ ├── inspector_tools.png │ │ │ └── inspector.png │ │ └── looker │ │ ├── _index.md │ │ ├── looker_gemini_oauth │ │ │ ├── _index.md │ │ │ ├── authenticated.png │ │ │ ├── authorize.png │ │ │ └── registration.png │ │ ├── looker_gemini.md │ │ └── looker_mcp_inspector │ │ ├── _index.md │ │ ├── inspector_tools.png │ │ └── inspector.png │ └── sdks │ ├── _index.md │ ├── go-sdk.md │ ├── js-sdk.md │ └── python-sdk.md ├── go.mod ├── go.sum ├── internal │ ├── auth │ │ ├── auth.go │ │ └── google │ │ └── google.go │ ├── log │ │ ├── handler.go │ │ ├── log_test.go │ │ ├── log.go │ │ └── logger.go │ ├── prebuiltconfigs │ │ ├── prebuiltconfigs_test.go │ │ ├── prebuiltconfigs.go │ │ └── tools │ │ ├── alloydb-postgres-admin.yaml │ │ ├── alloydb-postgres-observability.yaml │ │ ├── alloydb-postgres.yaml │ │ ├── bigquery.yaml │ │ ├── clickhouse.yaml │ │ ├── cloud-sql-mssql-admin.yaml │ │ ├── cloud-sql-mssql-observability.yaml │ │ ├── cloud-sql-mssql.yaml │ │ ├── cloud-sql-mysql-admin.yaml │ │ ├── cloud-sql-mysql-observability.yaml │ │ ├── cloud-sql-mysql.yaml │ │ ├── cloud-sql-postgres-admin.yaml │ │ ├── cloud-sql-postgres-observability.yaml │ │ ├── cloud-sql-postgres.yaml │ │ ├── dataplex.yaml │ │ ├── firestore.yaml │ │ ├── looker-conversational-analytics.yaml │ │ ├── looker.yaml │ │ ├── mssql.yaml │ │ ├── mysql.yaml │ │ ├── neo4j.yaml │ │ ├── oceanbase.yaml │ │ ├── postgres.yaml │ │ ├── spanner-postgres.yaml │ │ ├── spanner.yaml │ │ └── sqlite.yaml │ ├── server │ │ ├── api_test.go │ │ ├── api.go │ │ ├── common_test.go │ │ ├── config.go │ │ ├── mcp │ │ │ ├── jsonrpc │ │ │ │ ├── jsonrpc_test.go │ │ │ │ └── jsonrpc.go │ │ │ ├── mcp.go │ │ │ ├── util │ │ │ │ └── lifecycle.go │ │ │ ├── v20241105 │ │ │ │ ├── method.go │ │ │ │ └── types.go │ │ │ ├── v20250326 │ │ │ │ ├── method.go │ │ │ │ └── types.go │ │ │ └── v20250618 │ │ │ ├── method.go │ │ │ └── types.go │ │ ├── mcp_test.go │ │ ├── mcp.go │ │ ├── server_test.go │ │ ├── server.go │ │ ├── static │ │ │ ├── assets │ │ │ │ └── mcptoolboxlogo.png │ │ │ ├── css │ │ │ │ └── style.css │ │ │ ├── index.html │ │ │ ├── js │ │ │ │ ├── auth.js │ │ │ │ ├── loadTools.js │ │ │ │ ├── mainContent.js │ │ │ │ ├── navbar.js │ │ │ │ ├── runTool.js │ │ │ │ ├── toolDisplay.js │ │ │ │ ├── tools.js │ │ │ │ └── toolsets.js │ │ │ ├── tools.html │ │ │ └── toolsets.html │ │ ├── web_test.go │ │ └── web.go │ ├── sources │ │ ├── alloydbadmin │ │ │ ├── alloydbadmin_test.go │ │ │ └── alloydbadmin.go │ │ ├── alloydbpg │ │ │ ├── alloydb_pg_test.go │ │ │ └── alloydb_pg.go │ │ ├── bigquery │ │ │ ├── bigquery_test.go │ │ │ └── bigquery.go │ │ ├── bigtable │ │ │ ├── bigtable_test.go │ │ │ └── bigtable.go │ │ ├── cassandra │ │ │ ├── cassandra_test.go │ │ │ └── cassandra.go │ │ ├── clickhouse │ │ │ ├── clickhouse_test.go │ │ │ └── clickhouse.go │ │ ├── cloudmonitoring │ │ │ ├── cloud_monitoring_test.go │ │ │ └── cloud_monitoring.go │ │ ├── cloudsqladmin │ │ │ ├── cloud_sql_admin_test.go │ │ │ └── cloud_sql_admin.go │ │ ├── cloudsqlmssql │ │ │ ├── cloud_sql_mssql_test.go │ │ │ └── cloud_sql_mssql.go │ │ ├── cloudsqlmysql │ │ │ ├── cloud_sql_mysql_test.go │ │ │ └── cloud_sql_mysql.go │ │ ├── cloudsqlpg │ │ │ ├── cloud_sql_pg_test.go │ │ │ └── cloud_sql_pg.go │ │ ├── couchbase │ │ │ ├── couchbase_test.go │ │ │ └── couchbase.go │ │ ├── dataplex │ │ │ ├── dataplex_test.go │ │ │ └── dataplex.go │ │ ├── dgraph │ │ │ ├── dgraph_test.go │ │ │ └── dgraph.go │ │ ├── dialect.go │ │ ├── firebird │ │ │ ├── firebird_test.go │ │ │ └── firebird.go │ │ ├── firestore │ │ │ ├── firestore_test.go │ │ │ └── firestore.go │ │ ├── http │ │ │ ├── http_test.go │ │ │ └── http.go │ │ ├── ip_type.go │ │ ├── looker │ │ │ ├── looker_test.go │ │ │ └── looker.go │ │ ├── mongodb │ │ │ ├── mongodb_test.go │ │ │ └── mongodb.go │ │ ├── mssql │ │ │ ├── mssql_test.go │ │ │ └── mssql.go │ │ ├── mysql │ │ │ ├── mysql_test.go │ │ │ └── mysql.go │ │ ├── neo4j │ │ │ ├── neo4j_test.go │ │ │ └── neo4j.go │ │ ├── oceanbase │ │ │ ├── oceanbase_test.go │ │ │ └── oceanbase.go │ │ ├── oracle │ │ │ └── oracle.go │ │ ├── postgres │ │ │ ├── postgres_test.go │ │ │ └── postgres.go │ │ ├── redis │ │ │ ├── redis_test.go │ │ │ └── redis.go │ │ ├── sources.go │ │ ├── spanner │ │ │ ├── spanner_test.go │ │ │ └── spanner.go │ │ ├── sqlite │ │ │ ├── sqlite_test.go │ │ │ └── sqlite.go │ │ ├── tidb │ │ │ ├── tidb_test.go │ │ │ └── tidb.go │ │ ├── trino │ │ │ ├── trino_test.go │ │ │ └── trino.go │ │ ├── util.go │ │ ├── valkey │ │ │ ├── valkey_test.go │ │ │ └── valkey.go │ │ └── yugabytedb │ │ ├── yugabytedb_test.go │ │ └── yugabytedb.go │ ├── telemetry │ │ ├── instrumentation.go │ │ └── telemetry.go │ ├── testutils │ │ └── testutils.go │ ├── tools │ │ ├── alloydb │ │ │ ├── alloydbcreatecluster │ │ │ │ ├── alloydbcreatecluster_test.go │ │ │ │ └── alloydbcreatecluster.go │ │ │ ├── alloydbcreateinstance │ │ │ │ ├── alloydbcreateinstance_test.go │ │ │ │ └── alloydbcreateinstance.go │ │ │ ├── alloydbcreateuser │ │ │ │ ├── alloydbcreateuser_test.go │ │ │ │ └── alloydbcreateuser.go │ │ │ ├── alloydbgetcluster │ │ │ │ ├── alloydbgetcluster_test.go │ │ │ │ └── alloydbgetcluster.go │ │ │ ├── alloydbgetinstance │ │ │ │ ├── alloydbgetinstance_test.go │ │ │ │ └── alloydbgetinstance.go │ │ │ ├── alloydbgetuser │ │ │ │ ├── alloydbgetuser_test.go │ │ │ │ └── alloydbgetuser.go │ │ │ ├── alloydblistclusters │ │ │ │ ├── alloydblistclusters_test.go │ │ │ │ └── alloydblistclusters.go │ │ │ ├── alloydblistinstances │ │ │ │ ├── alloydblistinstances_test.go │ │ │ │ └── alloydblistinstances.go │ │ │ ├── alloydblistusers │ │ │ │ ├── alloydblistusers_test.go │ │ │ │ └── alloydblistusers.go │ │ │ └── alloydbwaitforoperation │ │ │ ├── alloydbwaitforoperation_test.go │ │ │ └── alloydbwaitforoperation.go │ │ ├── alloydbainl │ │ │ ├── alloydbainl_test.go │ │ │ └── alloydbainl.go │ │ ├── bigquery │ │ │ ├── bigqueryanalyzecontribution │ │ │ │ ├── bigqueryanalyzecontribution_test.go │ │ │ │ └── bigqueryanalyzecontribution.go │ │ │ ├── bigquerycommon │ │ │ │ ├── table_name_parser_test.go │ │ │ │ ├── table_name_parser.go │ │ │ │ └── util.go │ │ │ ├── bigqueryconversationalanalytics │ │ │ │ ├── bigqueryconversationalanalytics_test.go │ │ │ │ └── bigqueryconversationalanalytics.go │ │ │ ├── bigqueryexecutesql │ │ │ │ ├── bigqueryexecutesql_test.go │ │ │ │ └── bigqueryexecutesql.go │ │ │ ├── bigqueryforecast │ │ │ │ ├── bigqueryforecast_test.go │ │ │ │ └── bigqueryforecast.go │ │ │ ├── bigquerygetdatasetinfo │ │ │ │ ├── bigquerygetdatasetinfo_test.go │ │ │ │ └── bigquerygetdatasetinfo.go │ │ │ ├── bigquerygettableinfo │ │ │ │ ├── bigquerygettableinfo_test.go │ │ │ │ └── bigquerygettableinfo.go │ │ │ ├── bigquerylistdatasetids │ │ │ │ ├── bigquerylistdatasetids_test.go │ │ │ │ └── bigquerylistdatasetids.go │ │ │ ├── bigquerylisttableids │ │ │ │ ├── bigquerylisttableids_test.go │ │ │ │ └── bigquerylisttableids.go │ │ │ ├── bigquerysearchcatalog │ │ │ │ ├── bigquerysearchcatalog_test.go │ │ │ │ └── bigquerysearchcatalog.go │ │ │ └── bigquerysql │ │ │ ├── bigquerysql_test.go │ │ │ └── bigquerysql.go │ │ ├── bigtable │ │ │ ├── bigtable_test.go │ │ │ └── bigtable.go │ │ ├── cassandra │ │ │ └── cassandracql │ │ │ ├── cassandracql_test.go │ │ │ └── cassandracql.go │ │ ├── clickhouse │ │ │ ├── clickhouseexecutesql │ │ │ │ ├── clickhouseexecutesql_test.go │ │ │ │ └── clickhouseexecutesql.go │ │ │ ├── clickhouselistdatabases │ │ │ │ ├── clickhouselistdatabases_test.go │ │ │ │ └── clickhouselistdatabases.go │ │ │ ├── clickhouselisttables │ │ │ │ ├── clickhouselisttables_test.go │ │ │ │ └── clickhouselisttables.go │ │ │ └── clickhousesql │ │ │ ├── clickhousesql_test.go │ │ │ └── clickhousesql.go │ │ ├── cloudmonitoring │ │ │ ├── cloudmonitoring_test.go │ │ │ └── cloudmonitoring.go │ │ ├── cloudsql │ │ │ ├── cloudsqlcreatedatabase │ │ │ │ ├── cloudsqlcreatedatabase_test.go │ │ │ │ └── cloudsqlcreatedatabase.go │ │ │ ├── cloudsqlcreateusers │ │ │ │ ├── cloudsqlcreateusers_test.go │ │ │ │ └── cloudsqlcreateusers.go │ │ │ ├── cloudsqlgetinstances │ │ │ │ ├── cloudsqlgetinstances_test.go │ │ │ │ └── cloudsqlgetinstances.go │ │ │ ├── cloudsqllistdatabases │ │ │ │ ├── cloudsqllistdatabases_test.go │ │ │ │ └── cloudsqllistdatabases.go │ │ │ ├── cloudsqllistinstances │ │ │ │ ├── cloudsqllistinstances_test.go │ │ │ │ └── cloudsqllistinstances.go │ │ │ └── cloudsqlwaitforoperation │ │ │ ├── cloudsqlwaitforoperation_test.go │ │ │ └── cloudsqlwaitforoperation.go │ │ ├── cloudsqlmssql │ │ │ └── cloudsqlmssqlcreateinstance │ │ │ ├── cloudsqlmssqlcreateinstance_test.go │ │ │ └── cloudsqlmssqlcreateinstance.go │ │ ├── cloudsqlmysql │ │ │ └── cloudsqlmysqlcreateinstance │ │ │ ├── cloudsqlmysqlcreateinstance_test.go │ │ │ └── cloudsqlmysqlcreateinstance.go │ │ ├── cloudsqlpg │ │ │ └── cloudsqlpgcreateinstances │ │ │ ├── cloudsqlpgcreateinstances_test.go │ │ │ └── cloudsqlpgcreateinstances.go │ │ ├── common_test.go │ │ ├── common.go │ │ ├── couchbase │ │ │ ├── couchbase_test.go │ │ │ └── couchbase.go │ │ ├── dataform │ │ │ └── dataformcompilelocal │ │ │ ├── dataformcompilelocal_test.go │ │ │ └── dataformcompilelocal.go │ │ ├── dataplex │ │ │ ├── dataplexlookupentry │ │ │ │ ├── dataplexlookupentry_test.go │ │ │ │ └── dataplexlookupentry.go │ │ │ ├── dataplexsearchaspecttypes │ │ │ │ ├── dataplexsearchaspecttypes_test.go │ │ │ │ └── dataplexsearchaspecttypes.go │ │ │ └── dataplexsearchentries │ │ │ ├── dataplexsearchentries_test.go │ │ │ └── dataplexsearchentries.go │ │ ├── dgraph │ │ │ ├── dgraph_test.go │ │ │ └── dgraph.go │ │ ├── firebird │ │ │ ├── firebirdexecutesql │ │ │ │ ├── firebirdexecutesql_test.go │ │ │ │ └── firebirdexecutesql.go │ │ │ └── firebirdsql │ │ │ ├── firebirdsql_test.go │ │ │ └── firebirdsql.go │ │ ├── firestore │ │ │ ├── firestoreadddocuments │ │ │ │ ├── firestoreadddocuments_test.go │ │ │ │ └── firestoreadddocuments.go │ │ │ ├── firestoredeletedocuments │ │ │ │ ├── firestoredeletedocuments_test.go │ │ │ │ └── firestoredeletedocuments.go │ │ │ ├── firestoregetdocuments │ │ │ │ ├── firestoregetdocuments_test.go │ │ │ │ └── firestoregetdocuments.go │ │ │ ├── firestoregetrules │ │ │ │ ├── firestoregetrules_test.go │ │ │ │ └── firestoregetrules.go │ │ │ ├── firestorelistcollections │ │ │ │ ├── firestorelistcollections_test.go │ │ │ │ └── firestorelistcollections.go │ │ │ ├── firestorequery │ │ │ │ ├── firestorequery_test.go │ │ │ │ └── firestorequery.go │ │ │ ├── firestorequerycollection │ │ │ │ ├── firestorequerycollection_test.go │ │ │ │ └── firestorequerycollection.go │ │ │ ├── firestoreupdatedocument │ │ │ │ ├── firestoreupdatedocument_test.go │ │ │ │ └── firestoreupdatedocument.go │ │ │ ├── firestorevalidaterules │ │ │ │ ├── firestorevalidaterules_test.go │ │ │ │ └── firestorevalidaterules.go │ │ │ └── util │ │ │ ├── converter_test.go │ │ │ ├── converter.go │ │ │ ├── validator_test.go │ │ │ └── validator.go │ │ ├── http │ │ │ ├── http_test.go │ │ │ └── http.go │ │ ├── http_method.go │ │ ├── looker │ │ │ ├── lookeradddashboardelement │ │ │ │ ├── lookeradddashboardelement_test.go │ │ │ │ └── lookeradddashboardelement.go │ │ │ ├── lookercommon │ │ │ │ ├── lookercommon_test.go │ │ │ │ └── lookercommon.go │ │ │ ├── lookerconversationalanalytics │ │ │ │ ├── lookerconversationalanalytics_test.go │ │ │ │ └── lookerconversationalanalytics.go │ │ │ ├── lookergetdashboards │ │ │ │ ├── lookergetdashboards_test.go │ │ │ │ └── lookergetdashboards.go │ │ │ ├── lookergetdimensions │ │ │ │ ├── lookergetdimensions_test.go │ │ │ │ └── lookergetdimensions.go │ │ │ ├── lookergetexplores │ │ │ │ ├── lookergetexplores_test.go │ │ │ │ └── lookergetexplores.go │ │ │ ├── lookergetfilters │ │ │ │ ├── lookergetfilters_test.go │ │ │ │ └── lookergetfilters.go │ │ │ ├── lookergetlooks │ │ │ │ ├── lookergetlooks_test.go │ │ │ │ └── lookergetlooks.go │ │ │ ├── lookergetmeasures │ │ │ │ ├── lookergetmeasures_test.go │ │ │ │ └── lookergetmeasures.go │ │ │ ├── lookergetmodels │ │ │ │ ├── lookergetmodels_test.go │ │ │ │ └── lookergetmodels.go │ │ │ ├── lookergetparameters │ │ │ │ ├── lookergetparameters_test.go │ │ │ │ └── lookergetparameters.go │ │ │ ├── lookerhealthanalyze │ │ │ │ ├── lookerhealthanalyze_test.go │ │ │ │ └── lookerhealthanalyze.go │ │ │ ├── lookerhealthpulse │ │ │ │ ├── lookerhealthpulse_test.go │ │ │ │ └── lookerhealthpulse.go │ │ │ ├── lookerhealthvacuum │ │ │ │ ├── lookerhealthvacuum_test.go │ │ │ │ └── lookerhealthvacuum.go │ │ │ ├── lookermakedashboard │ │ │ │ ├── lookermakedashboard_test.go │ │ │ │ └── lookermakedashboard.go │ │ │ ├── lookermakelook │ │ │ │ ├── lookermakelook_test.go │ │ │ │ └── lookermakelook.go │ │ │ ├── lookerquery │ │ │ │ ├── lookerquery_test.go │ │ │ │ └── lookerquery.go │ │ │ ├── lookerquerysql │ │ │ │ ├── lookerquerysql_test.go │ │ │ │ └── lookerquerysql.go │ │ │ ├── lookerqueryurl │ │ │ │ ├── lookerqueryurl_test.go │ │ │ │ └── lookerqueryurl.go │ │ │ └── lookerrunlook │ │ │ ├── lookerrunlook_test.go │ │ │ └── lookerrunlook.go │ │ ├── mongodb │ │ │ ├── mongodbaggregate │ │ │ │ ├── mongodbaggregate_test.go │ │ │ │ └── mongodbaggregate.go │ │ │ ├── mongodbdeletemany │ │ │ │ ├── mongodbdeletemany_test.go │ │ │ │ └── mongodbdeletemany.go │ │ │ ├── mongodbdeleteone │ │ │ │ ├── mongodbdeleteone_test.go │ │ │ │ └── mongodbdeleteone.go │ │ │ ├── mongodbfind │ │ │ │ ├── mongodbfind_test.go │ │ │ │ └── mongodbfind.go │ │ │ ├── mongodbfindone │ │ │ │ ├── mongodbfindone_test.go │ │ │ │ └── mongodbfindone.go │ │ │ ├── mongodbinsertmany │ │ │ │ ├── mongodbinsertmany_test.go │ │ │ │ └── mongodbinsertmany.go │ │ │ ├── mongodbinsertone │ │ │ │ ├── mongodbinsertone_test.go │ │ │ │ └── mongodbinsertone.go │ │ │ ├── mongodbupdatemany │ │ │ │ ├── mongodbupdatemany_test.go │ │ │ │ └── mongodbupdatemany.go │ │ │ └── mongodbupdateone │ │ │ ├── mongodbupdateone_test.go │ │ │ └── mongodbupdateone.go │ │ ├── mssql │ │ │ ├── mssqlexecutesql │ │ │ │ ├── mssqlexecutesql_test.go │ │ │ │ └── mssqlexecutesql.go │ │ │ ├── mssqllisttables │ │ │ │ ├── mssqllisttables_test.go │ │ │ │ └── mssqllisttables.go │ │ │ └── mssqlsql │ │ │ ├── mssqlsql_test.go │ │ │ └── mssqlsql.go │ │ ├── mysql │ │ │ ├── mysqlcommon │ │ │ │ └── mysqlcommon.go │ │ │ ├── mysqlexecutesql │ │ │ │ ├── mysqlexecutesql_test.go │ │ │ │ └── mysqlexecutesql.go │ │ │ ├── mysqllistactivequeries │ │ │ │ ├── mysqllistactivequeries_test.go │ │ │ │ └── mysqllistactivequeries.go │ │ │ ├── mysqllisttablefragmentation │ │ │ │ ├── mysqllisttablefragmentation_test.go │ │ │ │ └── mysqllisttablefragmentation.go │ │ │ ├── mysqllisttables │ │ │ │ ├── mysqllisttables_test.go │ │ │ │ └── mysqllisttables.go │ │ │ ├── mysqllisttablesmissinguniqueindexes │ │ │ │ ├── mysqllisttablesmissinguniqueindexes_test.go │ │ │ │ └── mysqllisttablesmissinguniqueindexes.go │ │ │ └── mysqlsql │ │ │ ├── mysqlsql_test.go │ │ │ └── mysqlsql.go │ │ ├── neo4j │ │ │ ├── neo4jcypher │ │ │ │ ├── neo4jcypher_test.go │ │ │ │ └── neo4jcypher.go │ │ │ ├── neo4jexecutecypher │ │ │ │ ├── classifier │ │ │ │ │ ├── classifier_test.go │ │ │ │ │ └── classifier.go │ │ │ │ ├── neo4jexecutecypher_test.go │ │ │ │ └── neo4jexecutecypher.go │ │ │ └── neo4jschema │ │ │ ├── cache │ │ │ │ ├── cache_test.go │ │ │ │ └── cache.go │ │ │ ├── helpers │ │ │ │ ├── helpers_test.go │ │ │ │ └── helpers.go │ │ │ ├── neo4jschema_test.go │ │ │ ├── neo4jschema.go │ │ │ └── types │ │ │ └── types.go │ │ ├── oceanbase │ │ │ ├── oceanbaseexecutesql │ │ │ │ ├── oceanbaseexecutesql_test.go │ │ │ │ └── oceanbaseexecutesql.go │ │ │ └── oceanbasesql │ │ │ ├── oceanbasesql_test.go │ │ │ └── oceanbasesql.go │ │ ├── oracle │ │ │ ├── oracleexecutesql │ │ │ │ └── oracleexecutesql.go │ │ │ └── oraclesql │ │ │ └── oraclesql.go │ │ ├── parameters_test.go │ │ ├── parameters.go │ │ ├── postgres │ │ │ ├── postgresexecutesql │ │ │ │ ├── postgresexecutesql_test.go │ │ │ │ └── postgresexecutesql.go │ │ │ ├── postgreslistactivequeries │ │ │ │ ├── postgreslistactivequeries_test.go │ │ │ │ └── postgreslistactivequeries.go │ │ │ ├── postgreslistavailableextensions │ │ │ │ ├── postgreslistavailableextensions_test.go │ │ │ │ └── postgreslistavailableextensions.go │ │ │ ├── postgreslistinstalledextensions │ │ │ │ ├── postgreslistinstalledextensions_test.go │ │ │ │ └── postgreslistinstalledextensions.go │ │ │ ├── postgreslisttables │ │ │ │ ├── postgreslisttables_test.go │ │ │ │ └── postgreslisttables.go │ │ │ └── postgressql │ │ │ ├── postgressql_test.go │ │ │ └── postgressql.go │ │ ├── redis │ │ │ ├── redis_test.go │ │ │ └── redis.go │ │ ├── spanner │ │ │ ├── spannerexecutesql │ │ │ │ ├── spannerexecutesql_test.go │ │ │ │ └── spannerexecutesql.go │ │ │ ├── spannerlisttables │ │ │ │ ├── spannerlisttables_test.go │ │ │ │ └── spannerlisttables.go │ │ │ └── spannersql │ │ │ ├── spanner_test.go │ │ │ └── spannersql.go │ │ ├── sqlite │ │ │ ├── sqliteexecutesql │ │ │ │ ├── sqliteexecutesql_test.go │ │ │ │ └── sqliteexecutesql.go │ │ │ └── sqlitesql │ │ │ ├── sqlitesql_test.go │ │ │ └── sqlitesql.go │ │ ├── tidb │ │ │ ├── tidbexecutesql │ │ │ │ ├── tidbexecutesql_test.go │ │ │ │ └── tidbexecutesql.go │ │ │ └── tidbsql │ │ │ ├── tidbsql_test.go │ │ │ └── tidbsql.go │ │ ├── tools_test.go │ │ ├── tools.go │ │ ├── toolsets.go │ │ ├── trino │ │ │ ├── trinoexecutesql │ │ │ │ ├── trinoexecutesql_test.go │ │ │ │ └── trinoexecutesql.go │ │ │ └── trinosql │ │ │ ├── trinosql_test.go │ │ │ └── trinosql.go │ │ ├── utility │ │ │ └── wait │ │ │ ├── wait_test.go │ │ │ └── wait.go │ │ ├── valkey │ │ │ ├── valkey_test.go │ │ │ └── valkey.go │ │ └── yugabytedbsql │ │ ├── yugabytedbsql_test.go │ │ └── yugabytedbsql.go │ └── util │ └── util.go ├── LICENSE ├── logo.png ├── main.go ├── README.md └── tests ├── alloydb │ ├── alloydb_integration_test.go │ └── alloydb_wait_for_operation_test.go ├── alloydbainl │ └── alloydb_ai_nl_integration_test.go ├── alloydbpg │ └── alloydb_pg_integration_test.go ├── auth.go ├── bigquery │ └── bigquery_integration_test.go ├── bigtable │ └── bigtable_integration_test.go ├── cassandra │ └── cassandra_integration_test.go ├── clickhouse │ └── clickhouse_integration_test.go ├── cloudmonitoring │ └── cloud_monitoring_integration_test.go ├── cloudsql │ ├── cloud_sql_create_database_test.go │ ├── cloud_sql_create_users_test.go │ ├── cloud_sql_get_instances_test.go │ ├── cloud_sql_list_databases_test.go │ ├── cloudsql_list_instances_test.go │ └── cloudsql_wait_for_operation_test.go ├── cloudsqlmssql │ ├── cloud_sql_mssql_create_instance_integration_test.go │ └── cloud_sql_mssql_integration_test.go ├── cloudsqlmysql │ ├── cloud_sql_mysql_create_instance_integration_test.go │ └── cloud_sql_mysql_integration_test.go ├── cloudsqlpg │ ├── cloud_sql_pg_create_instances_test.go │ └── cloud_sql_pg_integration_test.go ├── common.go ├── couchbase │ └── couchbase_integration_test.go ├── dataform │ └── dataform_integration_test.go ├── dataplex │ └── dataplex_integration_test.go ├── dgraph │ └── dgraph_integration_test.go ├── firebird │ └── firebird_integration_test.go ├── firestore │ └── firestore_integration_test.go ├── http │ └── http_integration_test.go ├── looker │ └── looker_integration_test.go ├── mongodb │ └── mongodb_integration_test.go ├── mssql │ └── mssql_integration_test.go ├── mysql │ └── mysql_integration_test.go ├── neo4j │ └── neo4j_integration_test.go ├── oceanbase │ └── oceanbase_integration_test.go ├── option.go ├── oracle │ └── oracle_integration_test.go ├── postgres │ └── postgres_integration_test.go ├── redis │ └── redis_test.go ├── server.go ├── source.go ├── spanner │ └── spanner_integration_test.go ├── sqlite │ └── sqlite_integration_test.go ├── tidb │ └── tidb_integration_test.go ├── tool.go ├── trino │ └── trino_integration_test.go ├── utility │ └── wait_integration_test.go ├── valkey │ └── valkey_test.go └── yugabytedb └── yugabytedb_integration_test.go ``` # Files -------------------------------------------------------------------------------- /internal/prebuiltconfigs/tools/cloud-sql-postgres-admin.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | sources: 16 | cloud-sql-admin-source: 17 | kind: cloud-sql-admin 18 | 19 | tools: 20 | create_instance: 21 | kind: cloud-sql-postgres-create-instance 22 | source: cloud-sql-admin-source 23 | get_instance: 24 | kind: cloud-sql-get-instance 25 | source: cloud-sql-admin-source 26 | list_instances: 27 | kind: cloud-sql-list-instances 28 | source: cloud-sql-admin-source 29 | create_database: 30 | kind: cloud-sql-create-database 31 | source: cloud-sql-admin-source 32 | list_databases: 33 | kind: cloud-sql-list-databases 34 | source: cloud-sql-admin-source 35 | create_user: 36 | kind: cloud-sql-create-users 37 | source: cloud-sql-admin-source 38 | wait_for_operation: 39 | kind: cloud-sql-wait-for-operation 40 | source: cloud-sql-admin-source 41 | 42 | toolsets: 43 | cloud_sql_postgres_admin_tools: 44 | - create_instance 45 | - get_instance 46 | - list_instances 47 | - create_database 48 | - list_databases 49 | - create_user 50 | - wait_for_operation 51 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/looker/looker-get-explores.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "looker-get-explores" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "looker-get-explores" tool returns all explores 7 | for the given model from the source. 8 | aliases: 9 | - /resources/tools/looker-get-explores 10 | --- 11 | 12 | ## About 13 | 14 | A `looker-get-explores` tool returns all explores 15 | for a given model from the source. 16 | 17 | It's compatible with the following sources: 18 | 19 | - [looker](../../sources/looker.md) 20 | 21 | `looker-get-explores` accepts one parameter, the 22 | `model` id. 23 | 24 | The return type is an array of maps, each map is formatted like: 25 | 26 | ```json 27 | { 28 | "name": "explore name", 29 | "description": "explore description", 30 | "label": "explore label", 31 | "group_label": "group label" 32 | } 33 | ``` 34 | ## Example 35 | 36 | ```yaml 37 | tools: 38 | get_explores: 39 | kind: looker-get-explores 40 | source: looker-source 41 | description: | 42 | The get_explores tool retrieves the list of explores defined in a LookML model 43 | in the Looker system. 44 | 45 | It takes one parameter, the model_name looked up from get_models. 46 | ``` 47 | 48 | ## Reference 49 | 50 | | **field** | **type** | **required** | **description** | 51 | |-------------|:--------:|:------------:|----------------------------------------------------| 52 | | kind | string | true | Must be "looker-get-explores". | 53 | | source | string | true | Name of the source the SQL should execute on. | 54 | | description | string | true | Description of the tool that is passed to the LLM. | 55 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/mssql/mssql-execute-sql.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "mssql-execute-sql" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "mssql-execute-sql" tool executes a SQL statement against a SQL Server 7 | database. 8 | aliases: 9 | - /resources/tools/mssql-execute-sql 10 | --- 11 | 12 | ## About 13 | 14 | A `mssql-execute-sql` tool executes a SQL statement against a SQL Server 15 | database. It's compatible with any of the following sources: 16 | 17 | - [cloud-sql-mssql](../../sources/cloud-sql-mssql.md) 18 | - [mssql](../../sources/mssql.md) 19 | 20 | `mssql-execute-sql` takes one input parameter `sql` and run the sql 21 | statement against the `source`. 22 | 23 | > **Note:** This tool is intended for developer assistant workflows with 24 | > human-in-the-loop and shouldn't be used for production agents. 25 | 26 | ## Example 27 | 28 | ```yaml 29 | tools: 30 | execute_sql_tool: 31 | kind: mssql-execute-sql 32 | source: my-mssql-instance 33 | description: Use this tool to execute sql statement. 34 | ``` 35 | 36 | ## Reference 37 | 38 | | **field** | **type** | **required** | **description** | 39 | |-------------|:------------------------------------------:|:------------:|----------------------------------------------------| 40 | | kind | string | true | Must be "mssql-execute-sql". | 41 | | source | string | true | Name of the source the SQL should execute on. | 42 | | description | string | true | Description of the tool that is passed to the LLM. | 43 | ``` -------------------------------------------------------------------------------- /.github/sync-repo-settings.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Synchronize repository settings from a centralized config 16 | # https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings 17 | # Install: https://github.com/apps/sync-repo-settings 18 | 19 | # Disable merge commits 20 | rebaseMergeAllowed: true 21 | squashMergeAllowed: true 22 | mergeCommitAllowed: false 23 | # Enable branch protection 24 | branchProtectionRules: 25 | - pattern: main 26 | isAdminEnforced: true 27 | requiredStatusCheckContexts: 28 | - "cla/google" 29 | - "lint" 30 | - "conventionalcommits.org" 31 | - "header-check" 32 | # - Add required status checks like presubmit tests 33 | - "unit tests (ubuntu-latest)" 34 | - "unit tests (windows-latest)" 35 | - "unit tests (macos-latest)" 36 | - "integration-test-pr (toolbox-testing-438616)" 37 | requiredApprovingReviewCount: 1 38 | requiresCodeOwnerReviews: true 39 | requiresStrictStatusChecks: true 40 | 41 | # Set team access 42 | permissionRules: 43 | - team: senseai-eco 44 | permission: admin 45 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/postgres/postgres-list-installed-extensions.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "postgres-list-installed-extensions" 3 | type: docs 4 | weight: 1 5 | description: > 6 | The "postgres-list-installed-extensions" tool retrieves all PostgreSQL 7 | extensions installed on a Postgres database. 8 | aliases: 9 | - /resources/tools/postgres-list-installed-extensions 10 | --- 11 | 12 | ## About 13 | 14 | The `postgres-list-installed-extensions` tool retrieves all PostgreSQL 15 | extensions installed on a Postgres database. It's compatible with any of the 16 | following sources: 17 | 18 | - [alloydb-postgres](../../sources/alloydb-pg.md) 19 | - [cloud-sql-postgres](../../sources/cloud-sql-pg.md) 20 | - [postgres](../../sources/postgres.md) 21 | 22 | `postgres-list-installed-extensions` lists all installed PostgreSQL extensions 23 | (extension name, version, schema, owner, description) as JSON. The does not 24 | support any input parameter. 25 | 26 | ## Example 27 | 28 | ```yaml 29 | tools: 30 | list_installed_extensions: 31 | kind: postgres-list-installed-extensions 32 | source: postgres-source 33 | description: List all installed PostgreSQL extensions with their name, version, schema, owner, and description. 34 | ``` 35 | 36 | ## Reference 37 | 38 | | **field** | **type** | **required** | **description** | 39 | |-------------|:--------:|:------------:|----------------------------------------------------| 40 | | kind | string | true | Must be "postgres-list-active-queries". | 41 | | source | string | true | Name of the source the SQL should execute on. | 42 | | description | string | true | Description of the tool that is passed to the LLM. | 43 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/looker/looker-get-models.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "looker-get-models" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "looker-get-models" tool returns all the models in the source. 7 | aliases: 8 | - /resources/tools/looker-get-models 9 | --- 10 | 11 | ## About 12 | 13 | A `looker-get-models` tool returns all the models in the source. 14 | 15 | It's compatible with the following sources: 16 | 17 | - [looker](../../sources/looker.md) 18 | 19 | `looker-get-models` accepts no parameters. 20 | 21 | ## Example 22 | 23 | ```yaml 24 | tools: 25 | get_models: 26 | kind: looker-get-models 27 | source: looker-source 28 | description: | 29 | The get_models tool retrieves the list of LookML models in the Looker system. 30 | 31 | It takes no parameters. 32 | ``` 33 | 34 | ## Reference 35 | 36 | | **field** | **type** | **required** | **description** | 37 | |-------------|:------------------------------------------:|:------------:|--------------------------------------------------------------------------------------------------| 38 | | kind | string | true | Must be "looker-get-models". | 39 | | source | string | true | Name of the source the SQL should execute on. | 40 | | description | string | true | Description of the tool that is passed to the LLM. | 41 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/alloydb/alloydb-get-cluster.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: alloydb-get-cluster 3 | type: docs 4 | weight: 1 5 | description: "The \"alloydb-get-cluster\" tool retrieves details for a specific AlloyDB cluster.\n" 6 | aliases: [/resources/tools/alloydb-get-cluster] 7 | --- 8 | 9 | ## About 10 | 11 | The `alloydb-get-cluster` tool retrieves detailed information for a single, 12 | specified AlloyDB cluster. It is compatible with 13 | [alloydb-admin](../../sources/alloydb-admin.md) source. 14 | 15 | | Parameter | Type | Description | Required | 16 | | :--------- | :----- | :------------------------------------------------- | :------- | 17 | | `project` | string | The GCP project ID to get cluster for. | Yes | 18 | | `location` | string | The location of the cluster (e.g., 'us-central1'). | Yes | 19 | | `cluster` | string | The ID of the cluster to retrieve. | Yes | 20 | 21 | ## Example 22 | 23 | ```yaml 24 | tools: 25 | get_specific_cluster: 26 | kind: alloydb-get-cluster 27 | source: my-alloydb-admin-source 28 | description: Use this tool to retrieve details for a specific AlloyDB cluster. 29 | ``` 30 | 31 | ## Reference 32 | 33 | | **field** | **type** | **required** | **description** | 34 | | ----------- | :------: | :----------: | ---------------------------------------------------- | 35 | | kind | string | true | Must be alloydb-get-cluster. | 36 | | source | string | true | The name of an `alloydb-admin` source. | 37 | | description | string | false | Description of the tool that is passed to the agent. | 38 | ``` -------------------------------------------------------------------------------- /internal/tools/http_method.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | package tools 15 | 16 | import ( 17 | "context" 18 | "fmt" 19 | "net/http" 20 | "strings" 21 | ) 22 | 23 | // HTTPMethod is a string of a valid HTTP method (e.g "GET") 24 | type HTTPMethod string 25 | 26 | // isValidHTTPMethod checks if the input string matches one of the method constants defined in the net/http package 27 | func isValidHTTPMethod(method string) bool { 28 | 29 | switch method { 30 | case http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete, 31 | http.MethodPatch, http.MethodHead, http.MethodOptions, http.MethodTrace, 32 | http.MethodConnect: 33 | return true 34 | } 35 | return false 36 | } 37 | 38 | func (i *HTTPMethod) UnmarshalYAML(ctx context.Context, unmarshal func(interface{}) error) error { 39 | var httpMethod string 40 | if err := unmarshal(&httpMethod); err != nil { 41 | return fmt.Errorf(`error unmarshalling HTTP method: %s`, err) 42 | } 43 | httpMethod = strings.ToUpper(httpMethod) 44 | if !isValidHTTPMethod(httpMethod) { 45 | return fmt.Errorf(`%s is not a valid http method`, httpMethod) 46 | } 47 | *i = HTTPMethod(httpMethod) 48 | return nil 49 | } 50 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/alloydb/alloydb-list-users.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: alloydb-list-users 3 | type: docs 4 | weight: 1 5 | description: "The \"alloydb-list-users\" tool lists all database users within an AlloyDB cluster.\n" 6 | aliases: [/resources/tools/alloydb-list-users] 7 | --- 8 | 9 | ## About 10 | 11 | The `alloydb-list-users` tool lists all database users within an AlloyDB 12 | cluster. It is compatible with [alloydb-admin](../../sources/alloydb-admin.md) 13 | source. 14 | The tool takes the following input parameters: 15 | 16 | | Parameter | Type | Description | Required | 17 | | :--------- | :----- | :------------------------------------------------- | :------- | 18 | | `project` | string | The GCP project ID to list users for. | Yes | 19 | | `cluster` | string | The ID of the cluster to list users from. | Yes | 20 | | `location` | string | The location of the cluster (e.g., 'us-central1'). | Yes | 21 | 22 | ## Example 23 | 24 | ```yaml 25 | tools: 26 | list_users: 27 | kind: alloydb-list-users 28 | source: alloydb-admin-source 29 | description: Use this tool to list all database users within an AlloyDB cluster 30 | ``` 31 | 32 | ## Reference 33 | 34 | | **field** | **type** | **required** | **description** | 35 | | ----------- | :------: | :----------: | ---------------------------------------------------- | 36 | | kind | string | true | Must be alloydb-list-users. | 37 | | source | string | true | The name of an `alloydb-admin` source. | 38 | | description | string | false | Description of the tool that is passed to the agent. | 39 | ``` -------------------------------------------------------------------------------- /.ci/quickstart_test/setup_hotels_sample.sql: -------------------------------------------------------------------------------- ```sql 1 | -- Copyright 2025 Google LLC 2 | -- 3 | -- Licensed under the Apache License, Version 2.0 (the "License"); 4 | -- you may not use this file except in compliance with the License. 5 | -- You may obtain a copy of the License at 6 | -- 7 | -- http://www.apache.org/licenses/LICENSE-2.0 8 | -- 9 | -- Unless required by applicable law or agreed to in writing, software 10 | -- distributed under the License is distributed on an "AS IS" BASIS, 11 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | -- See the License for the specific language governing permissions and 13 | -- limitations under the License. 14 | 15 | TRUNCATE TABLE $TABLE_NAME; 16 | 17 | INSERT INTO $TABLE_NAME (id, name, location, price_tier, checkin_date, checkout_date, booked) 18 | VALUES 19 | (1, 'Hilton Basel', 'Basel', 'Luxury', '2024-04-22', '2024-04-20', B'0'), 20 | (2, 'Marriott Zurich', 'Zurich', 'Upscale', '2024-04-14', '2024-04-21', B'0'), 21 | (3, 'Hyatt Regency Basel', 'Basel', 'Upper Upscale', '2024-04-02', '2024-04-20', B'0'), 22 | (4, 'Radisson Blu Lucerne', 'Lucerne', 'Midscale', '2024-04-24', '2024-04-05', B'0'), 23 | (5, 'Best Western Bern', 'Bern', 'Upper Midscale', '2024-04-23', '2024-04-01', B'0'), 24 | (6, 'InterContinental Geneva', 'Geneva', 'Luxury', '2024-04-23', '2024-04-28', B'0'), 25 | (7, 'Sheraton Zurich', 'Zurich', 'Upper Upscale', '2024-04-27', '2024-04-02', B'0'), 26 | (8, 'Holiday Inn Basel', 'Basel', 'Upper Midscale', '2024-04-24', '2024-04-09', B'0'), 27 | (9, 'Courtyard Zurich', 'Zurich', 'Upscale', '2024-04-03', '2024-04-13', B'0'), 28 | (10, 'Comfort Inn Bern', 'Bern', 'Midscale', '2024-04-04', '2024-04-16', B'0'); ``` -------------------------------------------------------------------------------- /.hugo/layouts/shortcodes/ipynb.html: -------------------------------------------------------------------------------- ```html 1 | {{ $notebookFile := .Get 0 }} 2 | {{ with .Page.Resources.Get $notebookFile }} 3 | 4 | {{ $content := .Content | transform.Unmarshal }} 5 | {{ range $content.cells }} 6 | 7 | {{ if eq .cell_type "markdown" }} 8 | <div class="notebook-markdown"> 9 | {{ $markdown := "" }} 10 | {{ range .source }}{{ $markdown = print $markdown . }}{{ end }} 11 | {{ $markdown | markdownify }} 12 | </div> 13 | {{ end }} 14 | 15 | {{ if eq .cell_type "code" }} 16 | <div class="notebook-code"> 17 | {{ $code := "" }} 18 | {{ range .source }}{{ $code = print $code . }}{{ end }} 19 | {{ highlight $code "python" "" }} 20 | 21 | {{ range .outputs }} 22 | <div class="notebook-output"> 23 | {{ with .text }} 24 | <pre class="notebook-stream"><code>{{- range . }}{{ . }}{{ end -}}</code></pre> 25 | {{ end }} 26 | 27 | {{ with .data }} 28 | {{ with index . "image/png" }} 29 | <img src="data:image/png;base64,{{ . }}" alt="Notebook output image"> 30 | {{ end }} 31 | {{ with index . "image/jpeg" }} 32 | <img src="data:image/jpeg;base64,{{ . }}" alt="Notebook output image"> 33 | {{ end }} 34 | {{ with index . "text/html" }} 35 | {{ $html := "" }} 36 | {{ range . }}{{ $html = print $html . }}{{ end }} 37 | {{ $html | safeHTML }} 38 | {{ end }} 39 | {{ end }} 40 | </div> 41 | {{ end }} 42 | </div> 43 | {{ end }} 44 | {{ end }} 45 | {{ else }} 46 | <p style="color: red;">Error: Notebook '{{ $notebookFile }}' not found in page resources.</p> 47 | {{ end }} ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/cloudsql/cloudsqlcreatedatabase.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: cloud-sql-create-database 3 | type: docs 4 | weight: 10 5 | description: > 6 | Create a new database in a Cloud SQL instance. 7 | --- 8 | 9 | The `cloud-sql-create-database` tool creates a new database in a specified Cloud 10 | SQL instance. 11 | 12 | {{< notice info >}} 13 | This tool uses a `source` of kind `cloud-sql-admin`. 14 | {{< /notice >}} 15 | 16 | ## Example 17 | 18 | ```yaml 19 | tools: 20 | create-cloud-sql-database: 21 | kind: cloud-sql-create-database 22 | source: my-cloud-sql-admin-source 23 | description: "Creates a new database in a Cloud SQL instance." 24 | ``` 25 | 26 | ## Reference 27 | 28 | | **field** | **type** | **required** | **description** | 29 | | ----------- | :------: | :----------: | ------------------------------------------------ | 30 | | kind | string | true | Must be "cloud-sql-create-database". | 31 | | source | string | true | The name of the `cloud-sql-admin` source to use. | 32 | | description | string | false | A description of the tool. | 33 | 34 | ## Input Parameters 35 | 36 | | **parameter** | **type** | **required** | **description** | 37 | | ------------- | :------: | :----------: | ------------------------------------------------------------------ | 38 | | project | string | true | The project ID. | 39 | | instance | string | true | The ID of the instance where the database will be created. | 40 | | name | string | true | The name for the new database. Must be unique within the instance. | 41 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/looker/looker-conversational-analytics.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "looker-conversational-analytics" 3 | type: docs 4 | weight: 1 5 | description: > 6 | The "looker-conversational-analytics" tool will use the Conversational 7 | Analaytics API to analyze data from Looker 8 | aliases: 9 | - /resources/tools/looker-conversational-analytics 10 | --- 11 | 12 | ## About 13 | 14 | A `looker-conversational-analytics` tool allows you to ask questions about your Looker data. 15 | 16 | It's compatible with the following sources: 17 | 18 | - [looker](../../sources/looker.md) 19 | 20 | `looker-conversational-analytics` accepts two parameters: 21 | 22 | 1. `user_query_with_context`: The question asked of the Conversational Analytics system. 23 | 2. `explore_references`: A list of one to five explores that can be queried to answer the 24 | question. The form of the entry is `[{"model": "model name", "explore": "explore name"}, ...]` 25 | 26 | ## Example 27 | 28 | ```yaml 29 | tools: 30 | ask_data_insights: 31 | kind: looker-conversational-analytics 32 | source: looker-source 33 | description: | 34 | Use this tool to perform data analysis, get insights, 35 | or answer complex questions about the contents of specific 36 | Looker explores. 37 | ``` 38 | 39 | ## Reference 40 | 41 | | **field** | **type** | **required** | **description** | 42 | |-------------|:--------:|:------------:|----------------------------------------------------| 43 | | kind | string | true | Must be "lookerca-conversational-analytics". | 44 | | source | string | true | Name of the source the SQL should execute on. | 45 | | description | string | true | Description of the tool that is passed to the LLM. | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/cloudsql/cloudsqllistinstances.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: Cloud SQL List Instances 3 | type: docs 4 | weight: 1 5 | description: "List Cloud SQL instances in a project.\n" 6 | --- 7 | 8 | The `cloud-sql-list-instances` tool lists all Cloud SQL instances in a specified 9 | Google Cloud project. 10 | 11 | {{< notice info >}} 12 | This tool uses the `cloud-sql-admin` source, which automatically handles 13 | authentication on behalf of the user. 14 | {{< /notice >}} 15 | 16 | ## Configuration 17 | 18 | Here is an example of how to configure the `cloud-sql-list-instances` tool in 19 | your `tools.yaml` file: 20 | 21 | ```yaml 22 | sources: 23 | my-cloud-sql-admin-source: 24 | kind: cloud-sql-admin 25 | 26 | tools: 27 | list_my_instances: 28 | kind: cloud-sql-list-instances 29 | source: my-cloud-sql-admin-source 30 | description: Use this tool to list all Cloud SQL instances in a project. 31 | ``` 32 | 33 | ## Parameters 34 | 35 | The `cloud-sql-list-instances` tool has one required parameter: 36 | 37 | | **field** | **type** | **required** | **description** | 38 | | --------- | :------: | :----------: | ---------------------------- | 39 | | project | string | true | The Google Cloud project ID. | 40 | 41 | ## Reference 42 | 43 | | **field** | **type** | **required** | **description** | 44 | |-------------|:--------:|:------------:|----------------------------------------------------------------| 45 | | kind | string | true | Must be "cloud-sql-list-instances". | 46 | | description | string | false | Description of the tool that is passed to the agent. | 47 | | source | string | true | The name of the `cloud-sql-admin` source to use for this tool. | 48 | ``` -------------------------------------------------------------------------------- /internal/prebuiltconfigs/tools/spanner.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | sources: 16 | spanner-source: 17 | kind: spanner 18 | project: ${SPANNER_PROJECT} 19 | instance: ${SPANNER_INSTANCE} 20 | database: ${SPANNER_DATABASE} 21 | dialect: ${SPANNER_DIALECT:googlesql} 22 | 23 | tools: 24 | execute_sql: 25 | kind: spanner-execute-sql 26 | source: spanner-source 27 | description: Use this tool to execute DML SQL. Please use the ${SPANNER_DIALECT:googlesql} interface for Spanner. 28 | 29 | execute_sql_dql: 30 | kind: spanner-execute-sql 31 | source: spanner-source 32 | description: Use this tool to execute DQL SQL. Please use the ${SPANNER_DIALECT:googlesql} interface for Spanner. 33 | readOnly: true 34 | 35 | list_tables: 36 | kind: spanner-list-tables 37 | source: spanner-source 38 | description: "Lists detailed schema information (object type, columns, constraints, indexes) as JSON for user-created tables (ordinary or partitioned). Filters by a comma-separated list of names. If names are omitted, lists all tables in user schemas." 39 | 40 | toolsets: 41 | spanner-database-tools: 42 | - execute_sql 43 | - execute_sql_dql 44 | - list_tables 45 | ``` -------------------------------------------------------------------------------- /cmd/options_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2024 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package cmd 16 | 17 | import ( 18 | "errors" 19 | "io" 20 | "testing" 21 | 22 | "github.com/spf13/cobra" 23 | ) 24 | 25 | func TestCommandOptions(t *testing.T) { 26 | w := io.Discard 27 | tcs := []struct { 28 | desc string 29 | isValid func(*Command) error 30 | option Option 31 | }{ 32 | { 33 | desc: "with logger", 34 | isValid: func(c *Command) error { 35 | if c.outStream != w || c.errStream != w { 36 | return errors.New("loggers do not match") 37 | } 38 | return nil 39 | }, 40 | option: WithStreams(w, w), 41 | }, 42 | } 43 | for _, tc := range tcs { 44 | t.Run(tc.desc, func(t *testing.T) { 45 | got, err := invokeProxyWithOption(tc.option) 46 | if err != nil { 47 | t.Fatal(err) 48 | } 49 | if err := tc.isValid(got); err != nil { 50 | t.Errorf("option did not initialize command correctly: %v", err) 51 | } 52 | }) 53 | } 54 | } 55 | 56 | func invokeProxyWithOption(o Option) (*Command, error) { 57 | c := NewCommand(o) 58 | // Keep the test output quiet 59 | c.SilenceUsage = true 60 | c.SilenceErrors = true 61 | // Disable execute behavior 62 | c.RunE = func(*cobra.Command, []string) error { 63 | return nil 64 | } 65 | 66 | err := c.Execute() 67 | return c, err 68 | } 69 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/alloydb/alloydb-get-user.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: alloydb-get-user 3 | type: docs 4 | weight: 1 5 | description: "The \"alloydb-get-user\" tool retrieves details for a specific AlloyDB user.\n" 6 | aliases: [/resources/tools/alloydb-get-user] 7 | --- 8 | 9 | ## About 10 | 11 | The `alloydb-get-user` tool retrieves detailed information for a single, 12 | specified AlloyDB user. It is compatible with 13 | [alloydb-admin](../../sources/alloydb-admin.md) source. 14 | 15 | | Parameter | Type | Description | Required | 16 | | :--------- | :----- | :------------------------------------------------- | :------- | 17 | | `project` | string | The GCP project ID to get user for. | Yes | 18 | | `location` | string | The location of the cluster (e.g., 'us-central1'). | Yes | 19 | | `cluster` | string | The ID of the cluster to retrieve the user from. | Yes | 20 | | `user` | string | The ID of the user to retrieve. | Yes | 21 | 22 | ## Example 23 | 24 | ```yaml 25 | tools: 26 | get_specific_user: 27 | kind: alloydb-get-user 28 | source: my-alloydb-admin-source 29 | description: Use this tool to retrieve details for a specific AlloyDB user. 30 | ``` 31 | 32 | ## Reference 33 | 34 | | **field** | **type** | **required** | **description** | 35 | | ----------- | :------: | :----------: | ---------------------------------------------------- | 36 | | kind | string | true | Must be alloydb-get-user. | 37 | | source | string | true | The name of an `alloydb-admin` source. | 38 | | description | string | false | Description of the tool that is passed to the agent. | 39 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/looker/looker-run-look.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "looker-run-look" 3 | type: docs 4 | weight: 1 5 | description: > 6 | "looker-run-look" runs the query associated with a saved Look. 7 | aliases: 8 | - /resources/tools/looker-run-look 9 | --- 10 | 11 | ## About 12 | 13 | The `looker-run-look` tool runs the query associated with a 14 | saved Look. 15 | 16 | It's compatible with the following sources: 17 | 18 | - [looker](../../sources/looker.md) 19 | 20 | `looker-run-look` takes one parameter, the `look_id`. 21 | 22 | ## Example 23 | 24 | ```yaml 25 | tools: 26 | run_look: 27 | kind: looker-run-look 28 | source: looker-source 29 | description: | 30 | run_look Tool 31 | 32 | This tool runs the query associated with a look and returns 33 | the data in a JSON structure. It accepts the look_id as the 34 | parameter. 35 | ``` 36 | 37 | ## Reference 38 | 39 | | **field** | **type** | **required** | **description** | 40 | |-------------|:------------------------------------------:|:------------:|--------------------------------------------------------------------------------------------------| 41 | | kind | string | true | Must be "looker-run-look" | 42 | | source | string | true | Name of the source the SQL should execute on. | 43 | | description | string | true | Description of the tool that is passed to the LLM. | 44 | ``` -------------------------------------------------------------------------------- /internal/prebuiltconfigs/tools/cloud-sql-mssql.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | sources: 16 | cloudsql-mssql-source: 17 | kind: cloud-sql-mssql 18 | project: ${CLOUD_SQL_MSSQL_PROJECT} 19 | region: ${CLOUD_SQL_MSSQL_REGION} 20 | instance: ${CLOUD_SQL_MSSQL_INSTANCE} 21 | database: ${CLOUD_SQL_MSSQL_DATABASE} 22 | ipAddress: ${CLOUD_SQL_MSSQL_IP_ADDRESS} 23 | user: ${CLOUD_SQL_MSSQL_USER} 24 | password: ${CLOUD_SQL_MSSQL_PASSWORD} 25 | ipType: ${CLOUD_SQL_MSSQL_IP_TYPE:public} 26 | tools: 27 | execute_sql: 28 | kind: mssql-execute-sql 29 | source: cloudsql-mssql-source 30 | description: Use this tool to execute SQL. 31 | 32 | list_tables: 33 | kind: mssql-list-tables 34 | source: cloudsql-mssql-source 35 | description: "Lists detailed schema information (object type, columns, constraints, indexes, triggers, comment) as JSON for user-created tables (ordinary or partitioned). Filters by a comma-separated list of names. If names are omitted, lists all tables in user schemas." 36 | 37 | toolsets: 38 | cloud_sql_mssql_database_tools: 39 | - execute_sql 40 | - list_tables 41 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/cloudsql/cloudsqllistdatabases.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: cloud-sql-list-databases 3 | type: docs 4 | weight: 1 5 | description: List Cloud SQL databases in an instance. 6 | --- 7 | 8 | The `cloud-sql-list-databases` tool lists all Cloud SQL databases in a specified 9 | Google Cloud project and instance. 10 | 11 | {{< notice info >}} 12 | This tool uses the `cloud-sql-admin` source. 13 | {{< /notice >}} 14 | 15 | ## Configuration 16 | 17 | Here is an example of how to configure the `cloud-sql-list-databases` tool in your 18 | `tools.yaml` file: 19 | 20 | ```yaml 21 | sources: 22 | my-cloud-sql-admin-source: 23 | kind: cloud-sql-admin 24 | 25 | tools: 26 | list_my_databases: 27 | kind: cloud-sql-list-databases 28 | source: my-cloud-sql-admin-source 29 | description: Use this tool to list all Cloud SQL databases in an instance. 30 | ``` 31 | 32 | ## Parameters 33 | 34 | The `cloud-sql-list-databases` tool has two required parameters: 35 | 36 | | **field** | **type** | **required** | **description** | 37 | | --------- | :------: | :----------: | ---------------------------- | 38 | | project | string | true | The Google Cloud project ID. | 39 | | instance | string | true | The Cloud SQL instance ID. | 40 | 41 | ## Reference 42 | 43 | | **field** | **type** | **required** | **description** | 44 | | ----------- | :------: | :----------: | -------------------------------------------------------------- | 45 | | kind | string | true | Must be "cloud-sql-list-databases". | 46 | | source | string | true | The name of the `cloud-sql-admin` source to use for this tool. | 47 | | description | string | false | Description of the tool that is passed to the agent. | 48 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/spanner/spanner-execute-sql.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "spanner-execute-sql" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "spanner-execute-sql" tool executes a SQL statement against a Spanner 7 | database. 8 | aliases: 9 | - /resources/tools/spanner-execute-sql 10 | --- 11 | 12 | ## About 13 | 14 | A `spanner-execute-sql` tool executes a SQL statement against a Spanner 15 | database. It's compatible with any of the following sources: 16 | 17 | - [spanner](../../sources/spanner.md) 18 | 19 | `spanner-execute-sql` takes one input parameter `sql` and run the sql 20 | statement against the `source`. 21 | 22 | > **Note:** This tool is intended for developer assistant workflows with 23 | > human-in-the-loop and shouldn't be used for production agents. 24 | 25 | ## Example 26 | 27 | ```yaml 28 | tools: 29 | execute_sql_tool: 30 | kind: spanner-execute-sql 31 | source: my-spanner-instance 32 | description: Use this tool to execute sql statement. 33 | ``` 34 | 35 | ## Reference 36 | 37 | | **field** | **type** | **required** | **description** | 38 | |-------------|:--------:|:------------:|------------------------------------------------------------------------------------------| 39 | | kind | string | true | Must be "spanner-execute-sql". | 40 | | source | string | true | Name of the source the SQL should execute on. | 41 | | description | string | true | Description of the tool that is passed to the LLM. | 42 | | readOnly | bool | false | When set to `true`, the `statement` is run as a read-only transaction. Default: `false`. | 43 | 44 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/firestore/firestore-list-collections.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "firestore-list-collections" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "firestore-list-collections" tool lists collections in Firestore, either at the root level or as subcollections of a document. 7 | aliases: 8 | - /resources/tools/firestore-list-collections 9 | --- 10 | 11 | ## About 12 | 13 | A `firestore-list-collections` tool lists 14 | [collections](https://firebase.google.com/docs/firestore/data-model#collections) 15 | in Firestore, either at the root level or as 16 | [subcollections](https://firebase.google.com/docs/firestore/data-model#subcollections) 17 | of a specific document. 18 | It's compatible with the following sources: 19 | 20 | - [firestore](../../sources/firestore.md) 21 | 22 | `firestore-list-collections` takes an optional `parentPath` parameter to specify 23 | a document path. If provided, it lists all subcollections of that document. If 24 | not provided, it lists all root-level collections in the database. 25 | 26 | ## Example 27 | 28 | ```yaml 29 | tools: 30 | list_firestore_collections: 31 | kind: firestore-list-collections 32 | source: my-firestore-source 33 | description: Use this tool to list collections in Firestore. 34 | ``` 35 | 36 | ## Reference 37 | 38 | | **field** | **type** | **required** | **description** | 39 | |-------------|:----------------:|:------------:|--------------------------------------------------------| 40 | | kind | string | true | Must be "firestore-list-collections". | 41 | | source | string | true | Name of the Firestore source to list collections from. | 42 | | description | string | true | Description of the tool that is passed to the LLM. | 43 | ``` -------------------------------------------------------------------------------- /internal/server/static/toolsets.html: -------------------------------------------------------------------------------- ```html 1 | <!DOCTYPE html> 2 | <html lang="en"> 3 | <head> 4 | <meta charset="UTF-8"> 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6 | <title>Toolsets View</title> 7 | <link rel="stylesheet" href="/ui/css/style.css"> 8 | <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> 9 | <script src="https://accounts.google.com/gsi/client" async defer></script> 10 | </head> 11 | <body> 12 | <div id="navbar-container" data-active-nav="/ui/toolsets"></div> 13 | 14 | <aside class="second-nav"> 15 | <h4>Retrieve Toolset</h4> 16 | <div class="search-container"> 17 | <input type="text" id="toolset-search-input" placeholder="Enter toolset name..."> 18 | <button id="toolset-search-button" aria-label="Retrieve Tools"> 19 | <span class="material-icons">search</span> 20 | </button> 21 | </div> 22 | <div id="secondary-panel-content"> 23 | <p>Retrieve toolset to see available tools.</p> 24 | </div> 25 | </aside> 26 | 27 | <div id="main-content-container"></div> 28 | 29 | <script type="module" src="/ui/js/toolsets.js"></script> 30 | <script src="/ui/js/navbar.js"></script> 31 | <script src="/ui/js/mainContent.js"></script> 32 | <script> 33 | document.addEventListener('DOMContentLoaded', () => { 34 | const navbarContainer = document.getElementById('navbar-container'); 35 | const activeNav = navbarContainer.getAttribute('data-active-nav'); 36 | renderNavbar('navbar-container', activeNav); 37 | renderMainContent('main-content-container', 'tool-display-area', getToolsetInstructions()); 38 | }); 39 | </script> 40 | </body> 41 | </html> ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/dataform/dataform-compile-local.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "dataform-compile-local" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "dataform-compile-local" tool runs the `dataform compile` CLI command on a local project directory. 7 | aliases: 8 | - /resources/tools/dataform-compile-local 9 | --- 10 | 11 | ## About 12 | 13 | A `dataform-compile-local` tool runs the `dataform compile` command on a local Dataform project. 14 | 15 | It is a standalone tool and **is not** compatible with any sources. 16 | 17 | At invocation time, the tool executes `dataform compile --json` in the specified project directory and returns the resulting JSON object from the CLI. 18 | 19 | `dataform-compile-local` takes the following parameter: 20 | 21 | - `project_dir` (string): The absolute or relative path to the local Dataform project directory. The server process must have read access to this path. 22 | 23 | ## Requirements 24 | 25 | ### Dataform CLI 26 | 27 | This tool executes the `dataform` command-line interface (CLI) via a system call. You must have the **`dataform` CLI** installed and available in the server's system `PATH`. 28 | 29 | You can typically install the CLI via `npm`: 30 | 31 | ```bash 32 | npm install -g @dataform/cli 33 | ``` 34 | 35 | See the [official Dataform documentation](https://www.google.com/search?q=https://cloud.google.com/dataform/docs/install-dataform-cli) for more details. 36 | 37 | ## Example 38 | 39 | ```yaml 40 | tools: 41 | my_dataform_compiler: 42 | kind: dataform-compile-local 43 | description: Use this tool to compile a local Dataform project. 44 | ``` 45 | 46 | ## Reference 47 | 48 | | **field** | **type** | **required** | **description** | 49 | | :---- | :---- | :---- | :---- | 50 | | kind | string | true | Must be "dataform-compile-local". | 51 | | description | string | true | Description of the tool that is passed to the LLM. | 52 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/alloydb/alloydb-get-instance.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: alloydb-get-instance 3 | type: docs 4 | weight: 1 5 | description: "The \"alloydb-get-instance\" tool retrieves details for a specific AlloyDB instance.\n" 6 | aliases: [/resources/tools/alloydb-get-instance] 7 | --- 8 | 9 | ## About 10 | 11 | The `alloydb-get-instance` tool retrieves detailed information for a single, specified AlloyDB instance. It is compatible with [alloydb-admin](../../sources/alloydb-admin.md) source. 12 | 13 | | Parameter | Type | Description | Required | 14 | | :--------- | :----- | :-------------------------------------------------- | :------- | 15 | | `project` | string | The GCP project ID to get instance for. | Yes | 16 | | `location` | string | The location of the instance (e.g., 'us-central1'). | Yes | 17 | | `cluster` | string | The ID of the cluster. | Yes | 18 | | `instance` | string | The ID of the instance to retrieve. | Yes | 19 | 20 | ## Example 21 | 22 | ```yaml 23 | tools: 24 | get_specific_instance: 25 | kind: alloydb-get-instance 26 | source: my-alloydb-admin-source 27 | description: Use this tool to retrieve details for a specific AlloyDB instance. 28 | ``` 29 | 30 | ## Reference 31 | 32 | | **field** | **type** | **required** | **description** | 33 | | ----------- | :------: | :----------: | ---------------------------------------------------- | 34 | | kind | string | true | Must be alloydb-get-instance. | 35 | | source | string | true | The name of an `alloydb-admin` source. | 36 | | description | string | false | Description of the tool that is passed to the agent. | 37 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/tidb/tidb-execute-sql.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "tidb-execute-sql" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "tidb-execute-sql" tool executes a SQL statement against a TiDB 7 | database. 8 | aliases: 9 | - /resources/tools/tidb-execute-sql 10 | --- 11 | 12 | ## About 13 | 14 | A `tidb-execute-sql` tool executes a SQL statement against a TiDB 15 | database. It's compatible with the following source: 16 | 17 | - [tidb](../sources/tidb.md) 18 | 19 | `tidb-execute-sql` takes one input parameter `sql` and run the sql 20 | statement against the `source`. 21 | 22 | > **Note:** This tool is intended for developer assistant workflows with 23 | > human-in-the-loop and shouldn't be used for production agents. 24 | 25 | ## Example 26 | 27 | ```yaml 28 | tools: 29 | execute_sql_tool: 30 | kind: tidb-execute-sql 31 | source: my-tidb-instance 32 | description: Use this tool to execute sql statement. 33 | ``` 34 | 35 | ## Reference 36 | 37 | | **field** | **type** | **required** | **description** | 38 | |-------------|:------------------------------------------:|:------------:|--------------------------------------------------------------------------------------------------| 39 | | kind | string | true | Must be "tidb-execute-sql". | 40 | | source | string | true | Name of the source the SQL should execute on. | 41 | | description | string | true | Description of the tool that is passed to the LLM. | 42 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/trino/trino-execute-sql.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "trino-execute-sql" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "trino-execute-sql" tool executes a SQL statement against a Trino 7 | database. 8 | aliases: 9 | - /resources/tools/trino-execute-sql 10 | --- 11 | 12 | ## About 13 | 14 | A `trino-execute-sql` tool executes a SQL statement against a Trino 15 | database. It's compatible with any of the following sources: 16 | 17 | - [trino](../../sources/trino.md) 18 | 19 | `trino-execute-sql` takes one input parameter `sql` and run the sql 20 | statement against the `source`. 21 | 22 | > **Note:** This tool is intended for developer assistant workflows with 23 | > human-in-the-loop and shouldn't be used for production agents. 24 | 25 | ## Example 26 | 27 | ```yaml 28 | tools: 29 | execute_sql_tool: 30 | kind: trino-execute-sql 31 | source: my-trino-instance 32 | description: Use this tool to execute sql statement. 33 | ``` 34 | 35 | ## Reference 36 | 37 | | **field** | **type** | **required** | **description** | 38 | |-------------|:------------------------------------------:|:------------:|--------------------------------------------------------------------------------------------------| 39 | | kind | string | true | Must be "trino-execute-sql". | 40 | | source | string | true | Name of the source the SQL should execute on. | 41 | | description | string | true | Description of the tool that is passed to the LLM. | 42 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/redis/redis.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "redis" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "redis" tool executes a set of pre-defined Redis commands against a Redis instance. 7 | aliases: 8 | - /resources/tools/redis 9 | --- 10 | 11 | ## About 12 | 13 | A redis tool executes a series of pre-defined Redis commands against a 14 | Redis source. 15 | 16 | The specified Redis commands are executed sequentially. Each command is 17 | represented as a string list, where the first element is the command name (e.g., 18 | SET, GET, HGETALL) and subsequent elements are its arguments. 19 | 20 | ### Dynamic Command Parameters 21 | 22 | Command arguments can be templated using the `$variableName` annotation. The 23 | array type parameters will be expanded once into multiple arguments. Take the 24 | following config for example: 25 | 26 | ```yaml 27 | commands: 28 | - [SADD, userNames, $userNames] # Array will be flattened into multiple arguments. 29 | parameters: 30 | - name: userNames 31 | type: array 32 | description: The user names to be set. 33 | ``` 34 | 35 | If the input is an array of strings `["Alice", "Sid", "Bob"]`, The final command 36 | to be executed after argument expansion will be `[SADD, userNames, Alice, Sid, Bob]`. 37 | 38 | ## Example 39 | 40 | ```yaml 41 | tools: 42 | user_data_tool: 43 | kind: redis 44 | source: my-redis-instance 45 | description: | 46 | Use this tool to interact with user data stored in Redis. 47 | It can set, retrieve, and delete user-specific information. 48 | commands: 49 | - [SADD, userNames, $userNames] # Array will be flattened into multiple arguments. 50 | - [GET, $userId] 51 | parameters: 52 | - name: userId 53 | type: string 54 | description: The unique identifier for the user. 55 | - name: userNames 56 | type: array 57 | description: The user names to be set. 58 | ``` 59 | ``` -------------------------------------------------------------------------------- /.ci/quickstart_test/js.integration.cloudbuild.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | steps: 16 | - name: 'node:20' 17 | id: 'js-quickstart-test' 18 | entrypoint: 'bash' 19 | args: 20 | # The '-c' flag tells bash to execute the following string as a command. 21 | # The 'set -ex' enables debug output and exits on error for easier troubleshooting. 22 | - -c 23 | - | 24 | set -ex 25 | export VERSION=$(cat ./cmd/version.txt) 26 | chmod +x .ci/quickstart_test/run_js_tests.sh 27 | .ci/quickstart_test/run_js_tests.sh 28 | env: 29 | - 'CLOUD_SQL_INSTANCE=${_CLOUD_SQL_INSTANCE}' 30 | - 'GCP_PROJECT=${_GCP_PROJECT}' 31 | - 'DATABASE_NAME=${_DATABASE_NAME}' 32 | - 'DB_USER=${_DB_USER}' 33 | secretEnv: ['TOOLS_YAML_CONTENT', 'GOOGLE_API_KEY', 'DB_PASSWORD'] 34 | 35 | availableSecrets: 36 | secretManager: 37 | - versionName: projects/${_GCP_PROJECT}/secrets/${_TOOLS_YAML_SECRET}/versions/6 38 | env: 'TOOLS_YAML_CONTENT' 39 | - versionName: projects/${_GCP_PROJECT_NUMBER}/secrets/${_API_KEY_SECRET}/versions/latest 40 | env: 'GOOGLE_API_KEY' 41 | - versionName: projects/${_GCP_PROJECT}/secrets/${_DB_PASS_SECRET}/versions/latest 42 | env: 'DB_PASSWORD' 43 | 44 | timeout: 1000s 45 | 46 | options: 47 | logging: CLOUD_LOGGING_ONLY ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/valkey/valkey.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "valkey" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "valkey" tool executes a set of pre-defined Valkey commands against a Valkey instance. 7 | aliases: 8 | - /resources/tools/valkey 9 | --- 10 | 11 | ## About 12 | 13 | A valkey tool executes a series of pre-defined Valkey commands against a 14 | Valkey instance. 15 | 16 | The specified Valkey commands are executed sequentially. Each command is 17 | represented as a string array, where the first element is the command name 18 | (e.g., SET, GET, HGETALL) and subsequent elements are its arguments. 19 | 20 | ### Dynamic Command Parameters 21 | 22 | Command arguments can be templated using the `$variableName` annotation. The 23 | array type parameters will be expanded once into multiple arguments. Take the 24 | following config for example: 25 | 26 | ```yaml 27 | commands: 28 | - [SADD, userNames, $userNames] # Array will be flattened into multiple arguments. 29 | parameters: 30 | - name: userNames 31 | type: array 32 | description: The user names to be set. 33 | ``` 34 | 35 | If the input is an array of strings `["Alice", "Sid", "Bob"]`, The final command 36 | to be executed after argument expansion will be `[SADD, userNames, Alice, Sid, Bob]`. 37 | 38 | ## Example 39 | 40 | ```yaml 41 | tools: 42 | user_data_tool: 43 | kind: valkey 44 | source: my-valkey-instance 45 | description: | 46 | Use this tool to interact with user data stored in Valkey. 47 | It can set, retrieve, and delete user-specific information. 48 | commands: 49 | - [SADD, userNames, $userNames] # Array will be flattened into multiple arguments. 50 | - [GET, $userId] 51 | parameters: 52 | - name: userId 53 | type: string 54 | description: The unique identifier for the user. 55 | - name: userNames 56 | type: array 57 | description: The user names to be set. 58 | ``` 59 | ``` -------------------------------------------------------------------------------- /.ci/quickstart_test/go.integration.cloudbuild.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | steps: 16 | - name: 'golang:1.25.1' 17 | id: 'go-quickstart-test' 18 | entrypoint: 'bash' 19 | args: 20 | # The '-c' flag tells bash to execute the following string as a command. 21 | # The 'set -ex' enables debug output and exits on error for easier troubleshooting. 22 | - -c 23 | - | 24 | set -ex 25 | export VERSION=$(cat ./cmd/version.txt) 26 | chmod +x .ci/quickstart_test/run_go_tests.sh 27 | .ci/quickstart_test/run_go_tests.sh 28 | env: 29 | - 'CLOUD_SQL_INSTANCE=${_CLOUD_SQL_INSTANCE}' 30 | - 'GCP_PROJECT=${_GCP_PROJECT}' 31 | - 'DATABASE_NAME=${_DATABASE_NAME}' 32 | - 'DB_USER=${_DB_USER}' 33 | secretEnv: ['TOOLS_YAML_CONTENT', 'GOOGLE_API_KEY', 'DB_PASSWORD'] 34 | 35 | availableSecrets: 36 | secretManager: 37 | - versionName: projects/${_GCP_PROJECT}/secrets/${_TOOLS_YAML_SECRET}/versions/7 38 | env: 'TOOLS_YAML_CONTENT' 39 | - versionName: projects/${_GCP_PROJECT_NUMBER}/secrets/${_API_KEY_SECRET}/versions/latest 40 | env: 'GOOGLE_API_KEY' 41 | - versionName: projects/${_GCP_PROJECT}/secrets/${_DB_PASS_SECRET}/versions/latest 42 | env: 'DB_PASSWORD' 43 | 44 | timeout: 1000s 45 | 46 | options: 47 | logging: CLOUD_LOGGING_ONLY ``` -------------------------------------------------------------------------------- /.github/release-please.yml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | handleGHRelease: true 16 | packageName: genai-toolbox 17 | releaseType: simple 18 | versionFile: "cmd/version.txt" 19 | extraFiles: [ 20 | "README.md", 21 | "docs/en/getting-started/colab_quickstart.ipynb", 22 | "docs/en/getting-started/introduction/_index.md", 23 | "docs/en/getting-started/mcp_quickstart/_index.md", 24 | "docs/en/getting-started/quickstart/shared/configure_toolbox.md", 25 | "docs/en/samples/alloydb/_index.md", 26 | "docs/en/samples/alloydb/mcp_quickstart.md", 27 | "docs/en/samples/alloydb/ai-nl/alloydb_ai_nl.ipynb", 28 | "docs/en/samples/bigquery/local_quickstart.md", 29 | "docs/en/samples/bigquery/mcp_quickstart/_index.md", 30 | "docs/en/samples/bigquery/colab_quickstart_bigquery.ipynb", 31 | "docs/en/samples/looker/looker_gemini.md", 32 | "docs/en/samples/looker/looker_gemini_oauth/_index.md", 33 | "docs/en/samples/looker/looker_mcp_inspector/_index.md", 34 | "docs/en/how-to/connect-ide/looker_mcp.md", 35 | "docs/en/how-to/connect-ide/mysql_mcp.md", 36 | "docs/en/how-to/connect-ide/mssql_mcp.md", 37 | "docs/en/how-to/connect-ide/postgres_mcp.md", 38 | "docs/en/how-to/connect-ide/neo4j_mcp.md", 39 | "docs/en/how-to/connect-ide/sqlite_mcp.md", 40 | ] ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/mysql/mysql-execute-sql.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "mysql-execute-sql" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "mysql-execute-sql" tool executes a SQL statement against a MySQL 7 | database. 8 | aliases: 9 | - /resources/tools/mysql-execute-sql 10 | --- 11 | 12 | ## About 13 | 14 | A `mysql-execute-sql` tool executes a SQL statement against a MySQL 15 | database. It's compatible with any of the following sources: 16 | 17 | - [cloud-sql-mysql](../../sources/cloud-sql-mysql.md) 18 | - [mysql](../../sources/mysql.md) 19 | 20 | `mysql-execute-sql` takes one input parameter `sql` and run the sql 21 | statement against the `source`. 22 | 23 | > **Note:** This tool is intended for developer assistant workflows with 24 | > human-in-the-loop and shouldn't be used for production agents. 25 | 26 | ## Example 27 | 28 | ```yaml 29 | tools: 30 | execute_sql_tool: 31 | kind: mysql-execute-sql 32 | source: my-mysql-instance 33 | description: Use this tool to execute sql statement. 34 | ``` 35 | 36 | ## Reference 37 | 38 | | **field** | **type** | **required** | **description** | 39 | |-------------|:------------------------------------------:|:------------:|--------------------------------------------------------------------------------------------------| 40 | | kind | string | true | Must be "mysql-execute-sql". | 41 | | source | string | true | Name of the source the SQL should execute on. | 42 | | description | string | true | Description of the tool that is passed to the LLM. | 43 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/oracle/oracle-sql.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "oracle-sql" 3 | type: docs 4 | weight: 1 5 | description: > 6 | An "oracle-sql" tool executes a pre-defined SQL statement against an Oracle database. 7 | aliases: 8 | - /resources/tools/oracle-sql 9 | --- 10 | 11 | ## About 12 | 13 | An `oracle-sql` tool executes a pre-defined SQL statement against an 14 | Oracle database. It's compatible with the following source: 15 | 16 | - [oracle](../../sources/oracle.md) 17 | 18 | The specified SQL statement is executed using [prepared statements][oracle-stmt] 19 | for security and performance. It expects parameter placeholders in the SQL query 20 | to be in the native Oracle format (e.g., `:1`, `:2`). 21 | 22 | [oracle-stmt]: https://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html 23 | 24 | ## Example 25 | 26 | > **Note:** This tool uses parameterized queries to prevent SQL injections. 27 | > Query parameters can be used as substitutes for arbitrary expressions. 28 | > Parameters cannot be used as substitutes for identifiers, column names, table 29 | > names, or other parts of the query. 30 | 31 | ```yaml 32 | tools: 33 | search_flights_by_number: 34 | kind: oracle-sql 35 | source: my-oracle-instance 36 | statement: | 37 | SELECT * FROM flights 38 | WHERE airline = :1 39 | AND flight_number = :2 40 | FETCH FIRST 10 ROWS ONLY 41 | description: | 42 | Use this tool to get information for a specific flight. 43 | Takes an airline code and flight number and returns info on the flight. 44 | Do NOT use this tool with a flight id. Do NOT guess an airline code or flight number. 45 | Example: 46 | {{ 47 | "airline": "CY", 48 | "flight_number": "888", 49 | }} 50 | parameters: 51 | - name: airline 52 | type: string 53 | description: Airline unique 2 letter identifier 54 | - name: flight_number 55 | type: string 56 | description: 1 to 4 digit number 57 | ``` ``` -------------------------------------------------------------------------------- /.ci/quickstart_test/py.integration.cloudbuild.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | steps: 16 | - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:537.0.0' 17 | id: 'python-quickstart-test' 18 | entrypoint: 'bash' 19 | args: 20 | # The '-c' flag tells bash to execute the following string as a command. 21 | # The 'set -ex' enables debug output and exits on error for easier troubleshooting. 22 | - -c 23 | - | 24 | set -ex 25 | export VERSION=$(cat ./cmd/version.txt) 26 | chmod +x .ci/quickstart_test/run_py_tests.sh 27 | .ci/quickstart_test/run_py_tests.sh 28 | env: 29 | - 'CLOUD_SQL_INSTANCE=${_CLOUD_SQL_INSTANCE}' 30 | - 'GCP_PROJECT=${_GCP_PROJECT}' 31 | - 'DATABASE_NAME=${_DATABASE_NAME}' 32 | - 'DB_USER=${_DB_USER}' 33 | secretEnv: ['TOOLS_YAML_CONTENT', 'GOOGLE_API_KEY', 'DB_PASSWORD'] 34 | 35 | availableSecrets: 36 | secretManager: 37 | - versionName: projects/${_GCP_PROJECT}/secrets/${_TOOLS_YAML_SECRET}/versions/5 38 | env: 'TOOLS_YAML_CONTENT' 39 | - versionName: projects/${_GCP_PROJECT_NUMBER}/secrets/${_API_KEY_SECRET}/versions/latest 40 | env: 'GOOGLE_API_KEY' 41 | - versionName: projects/${_GCP_PROJECT}/secrets/${_DB_PASS_SECRET}/versions/latest 42 | env: 'DB_PASSWORD' 43 | 44 | timeout: 1000s 45 | 46 | options: 47 | logging: CLOUD_LOGGING_ONLY 48 | ``` -------------------------------------------------------------------------------- /docs/en/resources/sources/cloud-monitoring.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "Cloud Monitoring" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "cloud-monitoring" source provides a client for the Cloud Monitoring API. 7 | aliases: 8 | - /resources/sources/cloud-monitoring 9 | --- 10 | 11 | ## About 12 | 13 | The `cloud-monitoring` source provides a client to interact with the [Google 14 | Cloud Monitoring API](https://cloud.google.com/monitoring/api). This allows 15 | tools to access cloud monitoring metrics explorer and run promql queries. 16 | 17 | Authentication can be handled in two ways: 18 | 1. **Application Default Credentials (ADC):** By default, the source uses ADC 19 | to authenticate with the API. 20 | 2. **Client-side OAuth:** If `useClientOAuth` is set to `true`, the source will 21 | expect an OAuth 2.0 access token to be provided by the client (e.g., a web 22 | browser) for each request. 23 | 24 | ## Example 25 | 26 | ```yaml 27 | sources: 28 | my-cloud-monitoring: 29 | kind: cloud-monitoring 30 | 31 | my-oauth-cloud-monitoring: 32 | kind: cloud-monitoring 33 | useClientOAuth: true 34 | ``` 35 | 36 | ## Reference 37 | 38 | | **field** | **type** | **required** | **description** | 39 | |----------------|:--------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------------------| 40 | | kind | string | true | Must be "cloud-monitoring". | 41 | | useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. | 42 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/clickhouse/clickhouse-execute-sql.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "clickhouse-execute-sql" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "clickhouse-execute-sql" tool executes a SQL statement against a ClickHouse 7 | database. 8 | aliases: 9 | - /resources/tools/clickhouse-execute-sql 10 | --- 11 | 12 | ## About 13 | 14 | A `clickhouse-execute-sql` tool executes a SQL statement against a ClickHouse 15 | database. It's compatible with the [clickhouse](../../sources/clickhouse.md) 16 | source. 17 | 18 | `clickhouse-execute-sql` takes one input parameter `sql` and runs the SQL 19 | statement against the specified `source`. This tool includes query logging 20 | capabilities for monitoring and debugging purposes. 21 | 22 | > **Note:** This tool is intended for developer assistant workflows with 23 | > human-in-the-loop and shouldn't be used for production agents. 24 | 25 | ## Example 26 | 27 | ```yaml 28 | tools: 29 | execute_sql_tool: 30 | kind: clickhouse-execute-sql 31 | source: my-clickhouse-instance 32 | description: Use this tool to execute SQL statements against ClickHouse. 33 | ``` 34 | 35 | ## Parameters 36 | 37 | | **parameter** | **type** | **required** | **description** | 38 | |---------------|:--------:|:------------:|---------------------------------------------------| 39 | | sql | string | true | The SQL statement to execute against the database | 40 | 41 | ## Reference 42 | 43 | | **field** | **type** | **required** | **description** | 44 | |-------------|:--------:|:------------:|-------------------------------------------------------| 45 | | kind | string | true | Must be "clickhouse-execute-sql". | 46 | | source | string | true | Name of the ClickHouse source to execute SQL against. | 47 | | description | string | true | Description of the tool that is passed to the LLM. | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/looker/looker-get-filters.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "looker-get-filters" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "looker-get-filters" tool returns all the filters from a given explore 7 | in a given model in the source. 8 | aliases: 9 | - /resources/tools/looker-get-filters 10 | --- 11 | 12 | ## About 13 | 14 | A `looker-get-filters` tool returns all the filters from a given explore 15 | in a given model in the source. 16 | 17 | It's compatible with the following sources: 18 | 19 | - [looker](../../sources/looker.md) 20 | 21 | `looker-get-filters` accepts two parameters, the `model` and the `explore`. 22 | 23 | ## Example 24 | 25 | ```yaml 26 | tools: 27 | get_dimensions: 28 | kind: looker-get-filters 29 | source: looker-source 30 | description: | 31 | The get_filters tool retrieves the list of filters defined in 32 | an explore. 33 | 34 | It takes two parameters, the model_name looked up from get_models and the 35 | explore_name looked up from get_explores. 36 | ``` 37 | 38 | The response is a json array with the following elements: 39 | 40 | ```json 41 | { 42 | "name": "field name", 43 | "description": "field description", 44 | "type": "field type", 45 | "label": "field label", 46 | "label_short": "field short label", 47 | "tags": ["tags", ...], 48 | "synonyms": ["synonyms", ...], 49 | "suggestions": ["suggestion", ...], 50 | "suggest_explore": "explore", 51 | "suggest_dimension": "dimension" 52 | } 53 | ``` 54 | 55 | 56 | ## Reference 57 | 58 | | **field** | **type** | **required** | **description** | 59 | |-------------|:--------:|:------------:|----------------------------------------------------| 60 | | kind | string | true | Must be "looker-get-filters". | 61 | | source | string | true | Name of the source the SQL should execute on. | 62 | | description | string | true | Description of the tool that is passed to the LLM. | 63 | ``` -------------------------------------------------------------------------------- /docs/en/resources/sources/cloud-sql-admin.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "Cloud SQL Admin" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "cloud-sql-admin" source provides a client for the Cloud SQL Admin API. 7 | aliases: 8 | - /resources/sources/cloud-sql-admin 9 | --- 10 | 11 | ## About 12 | 13 | The `cloud-sql-admin` source provides a client to interact with the [Google 14 | Cloud SQL Admin API](https://cloud.google.com/sql/docs/mysql/admin-api). This 15 | allows tools to perform administrative tasks on Cloud SQL instances, such as 16 | creating users and databases. 17 | 18 | Authentication can be handled in two ways: 19 | 1. **Application Default Credentials (ADC):** By default, the source uses ADC 20 | to authenticate with the API. 21 | 2. **Client-side OAuth:** If `useClientOAuth` is set to `true`, the source will 22 | expect an OAuth 2.0 access token to be provided by the client (e.g., a web 23 | browser) for each request. 24 | 25 | ## Example 26 | 27 | ```yaml 28 | sources: 29 | my-cloud-sql-admin: 30 | kind: cloud-sql-admin 31 | 32 | my-oauth-cloud-sql-admin: 33 | kind: cloud-sql-admin 34 | useClientOAuth: true 35 | ``` 36 | 37 | ## Reference 38 | 39 | | **field** | **type** | **required** | **description** | 40 | |----------------|:--------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------------------| 41 | | kind | string | true | Must be "cloud-sql-admin". | 42 | | useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. | 43 | ``` -------------------------------------------------------------------------------- /docs/en/resources/sources/alloydb-admin.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "AlloyDB Admin" 3 | linkTitle: "AlloyDB Admin" 4 | type: docs 5 | weight: 2 6 | description: > 7 | The "alloydb-admin" source provides a client for the AlloyDB API. 8 | aliases: 9 | - /resources/sources/alloydb-admin 10 | --- 11 | 12 | ## About 13 | 14 | The `alloydb-admin` source provides a client to interact with the [Google 15 | AlloyDB API](https://cloud.google.com/alloydb/docs/reference/rest). This allows 16 | tools to perform administrative tasks on AlloyDB resources, such as managing 17 | clusters, instances, and users. 18 | 19 | Authentication can be handled in two ways: 20 | 1. **Application Default Credentials (ADC):** By default, the source uses ADC 21 | to authenticate with the API. 22 | 2. **Client-side OAuth:** If `useClientOAuth` is set to `true`, the source will 23 | expect an OAuth 2.0 access token to be provided by the client (e.g., a web 24 | browser) for each request. 25 | 26 | ## Example 27 | 28 | ```yaml 29 | sources: 30 | my-alloydb-admin: 31 | kind: alloy-admin 32 | 33 | my-oauth-alloydb-admin: 34 | kind: alloydb-admin 35 | useClientOAuth: true 36 | ``` 37 | 38 | ## Reference 39 | | **field** | **type** | **required** | **description** | 40 | |----------------|:--------:|:------------:|------------------------------------------------------------------------------------------------------------------------------------------------| 41 | | kind | string | true | Must be "alloydb-admin". | 42 | | useClientOAuth | boolean | false | If true, the source will use client-side OAuth for authorization. Otherwise, it will use Application Default Credentials. Defaults to `false`. | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/bigquery/bigquery-get-dataset-info.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "bigquery-get-dataset-info" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "bigquery-get-dataset-info" tool retrieves metadata for a BigQuery dataset. 7 | aliases: 8 | - /resources/tools/bigquery-get-dataset-info 9 | --- 10 | 11 | ## About 12 | 13 | A `bigquery-get-dataset-info` tool retrieves metadata for a BigQuery dataset. 14 | It's compatible with the following sources: 15 | 16 | - [bigquery](../../sources/bigquery.md) 17 | 18 | `bigquery-get-dataset-info` takes a `dataset` parameter to specify the dataset 19 | on the given source. It also optionally accepts a `project` parameter to 20 | define the Google Cloud project ID. If the `project` parameter is not provided, 21 | the tool defaults to using the project defined in the source configuration. 22 | 23 | ## Example 24 | 25 | ```yaml 26 | tools: 27 | bigquery_get_dataset_info: 28 | kind: bigquery-get-dataset-info 29 | source: my-bigquery-source 30 | description: Use this tool to get dataset metadata. 31 | ``` 32 | 33 | ## Reference 34 | 35 | | **field** | **type** | **required** | **description** | 36 | |-------------|:------------------------------------------:|:------------:|--------------------------------------------------------------------------------------------------| 37 | | kind | string | true | Must be "bigquery-get-dataset-info". | 38 | | source | string | true | Name of the source the SQL should execute on. | 39 | | description | string | true | Description of the tool that is passed to the LLM. | 40 | ``` -------------------------------------------------------------------------------- /internal/prebuiltconfigs/tools/alloydb-postgres-admin.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | sources: 16 | alloydb-admin-source: 17 | kind: alloydb-admin 18 | tools: 19 | create_cluster: 20 | kind: alloydb-create-cluster 21 | source: alloydb-admin-source 22 | wait_for_operation: 23 | kind: alloydb-wait-for-operation 24 | source: alloydb-admin-source 25 | delay: 1s 26 | maxDelay: 4m 27 | multiplier: 2 28 | maxRetries: 10 29 | create_instance: 30 | kind: alloydb-create-instance 31 | source: alloydb-admin-source 32 | list_clusters: 33 | kind: alloydb-list-clusters 34 | source: alloydb-admin-source 35 | list_instances: 36 | kind: alloydb-list-instances 37 | source: alloydb-admin-source 38 | list_users: 39 | kind: alloydb-list-users 40 | source: alloydb-admin-source 41 | create_user: 42 | kind: alloydb-create-user 43 | source: alloydb-admin-source 44 | get_cluster: 45 | kind: alloydb-get-cluster 46 | source: alloydb-admin-source 47 | get_instance: 48 | kind: alloydb-get-instance 49 | source: alloydb-admin-source 50 | get_user: 51 | kind: alloydb-get-user 52 | source: alloydb-admin-source 53 | 54 | toolsets: 55 | alloydb_postgres_admin_tools: 56 | - create_cluster 57 | - wait_for_operation 58 | - create_instance 59 | - list_clusters 60 | - list_instances 61 | - list_users 62 | - create_user 63 | - get_cluster 64 | - get_instance 65 | - get_user 66 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/looker/looker-get-parameters.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "looker-get-parameters" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "looker-get-parameters" tool returns all the parameters from a given explore 7 | in a given model in the source. 8 | aliases: 9 | - /resources/tools/looker-get-parameters 10 | --- 11 | 12 | ## About 13 | 14 | A `looker-get-parameters` tool returns all the parameters from a given explore 15 | in a given model in the source. 16 | 17 | It's compatible with the following sources: 18 | 19 | - [looker](../../sources/looker.md) 20 | 21 | `looker-get-parameters` accepts two parameters, the `model` and the `explore`. 22 | 23 | ## Example 24 | 25 | ```yaml 26 | tools: 27 | get_parameters: 28 | kind: looker-get-parameters 29 | source: looker-source 30 | description: | 31 | The get_parameters tool retrieves the list of parameters defined in 32 | an explore. 33 | 34 | It takes two parameters, the model_name looked up from get_models and the 35 | explore_name looked up from get_explores. 36 | ``` 37 | 38 | The response is a json array with the following elements: 39 | 40 | ```json 41 | { 42 | "name": "field name", 43 | "description": "field description", 44 | "type": "field type", 45 | "label": "field label", 46 | "label_short": "field short label", 47 | "tags": ["tags", ...], 48 | "synonyms": ["synonyms", ...], 49 | "suggestions": ["suggestion", ...], 50 | "suggest_explore": "explore", 51 | "suggest_dimension": "dimension" 52 | } 53 | ``` 54 | 55 | 56 | ## Reference 57 | 58 | | **field** | **type** | **required** | **description** | 59 | |-------------|:--------:|:------------:|----------------------------------------------------| 60 | | kind | string | true | Must be "looker-get-parameters". | 61 | | source | string | true | Name of the source the SQL should execute on. | 62 | | description | string | true | Description of the tool that is passed to the LLM. | 63 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/postgres/postgres-execute-sql.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "postgres-execute-sql" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "postgres-execute-sql" tool executes a SQL statement against a Postgres 7 | database. 8 | aliases: 9 | - /resources/tools/postgres-execute-sql 10 | --- 11 | 12 | ## About 13 | 14 | A `postgres-execute-sql` tool executes a SQL statement against a Postgres 15 | database. It's compatible with any of the following sources: 16 | 17 | - [alloydb-postgres](../../sources/alloydb-pg.md) 18 | - [cloud-sql-postgres](../../sources/cloud-sql-pg.md) 19 | - [postgres](../../sources/postgres.md) 20 | 21 | `postgres-execute-sql` takes one input parameter `sql` and run the sql 22 | statement against the `source`. 23 | 24 | > **Note:** This tool is intended for developer assistant workflows with 25 | > human-in-the-loop and shouldn't be used for production agents. 26 | 27 | ## Example 28 | 29 | ```yaml 30 | tools: 31 | execute_sql_tool: 32 | kind: postgres-execute-sql 33 | source: my-pg-instance 34 | description: Use this tool to execute sql statement. 35 | ``` 36 | 37 | ## Reference 38 | 39 | | **field** | **type** | **required** | **description** | 40 | |-------------|:------------------------------------------:|:------------:|--------------------------------------------------------------------------------------------------| 41 | | kind | string | true | Must be "postgres-execute-sql". | 42 | | source | string | true | Name of the source the SQL should execute on. | 43 | | description | string | true | Description of the tool that is passed to the LLM. | 44 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/clickhouse/clickhouse-list-databases.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "clickhouse-list-databases" 3 | type: docs 4 | weight: 3 5 | description: > 6 | A "clickhouse-list-databases" tool lists all databases in a ClickHouse instance. 7 | aliases: 8 | - /resources/tools/clickhouse-list-databases 9 | --- 10 | 11 | ## About 12 | 13 | A `clickhouse-list-databases` tool lists all available databases in a ClickHouse 14 | instance. It's compatible with the [clickhouse](../../sources/clickhouse.md) 15 | source. 16 | 17 | This tool executes the `SHOW DATABASES` command and returns a list of all 18 | databases accessible to the configured user, making it useful for database 19 | discovery and exploration tasks. 20 | 21 | ## Example 22 | 23 | ```yaml 24 | tools: 25 | list_clickhouse_databases: 26 | kind: clickhouse-list-databases 27 | source: my-clickhouse-instance 28 | description: List all available databases in the ClickHouse instance 29 | ``` 30 | 31 | ## Return Value 32 | 33 | The tool returns an array of objects, where each object contains: 34 | 35 | - `name`: The name of the database 36 | 37 | Example response: 38 | 39 | ```json 40 | [ 41 | {"name": "default"}, 42 | {"name": "system"}, 43 | {"name": "analytics"}, 44 | {"name": "user_data"} 45 | ] 46 | ``` 47 | 48 | ## Reference 49 | 50 | | **field** | **type** | **required** | **description** | 51 | |--------------|:------------------:|:------------:|-------------------------------------------------------| 52 | | kind | string | true | Must be "clickhouse-list-databases". | 53 | | source | string | true | Name of the ClickHouse source to list databases from. | 54 | | description | string | true | Description of the tool that is passed to the LLM. | 55 | | authRequired | array of string | false | Authentication services required to use this tool. | 56 | | parameters | array of Parameter | false | Parameters for the tool (typically not used). | 57 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/mssql/mssql-list-tables.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "mssql-list-tables" 3 | type: docs 4 | weight: 1 5 | description: > 6 | The "mssql-list-tables" tool lists schema information for all or specified tables in a SQL server database. 7 | aliases: 8 | - /resources/tools/mssql-list-tables 9 | --- 10 | 11 | ## About 12 | 13 | The `mssql-list-tables` tool retrieves schema information for all or specified 14 | tables in a SQL server database. It is compatible with any of the following 15 | sources: 16 | 17 | - [cloud-sql-mssql](../../sources/cloud-sql-mssql.md) 18 | - [mssql](../../sources/mssql.md) 19 | 20 | `mssql-list-tables` lists detailed schema information (object type, columns, 21 | constraints, indexes, triggers, owner, comment) as JSON for user-created tables 22 | (ordinary or partitioned). 23 | 24 | The tool takes the following input parameters: 25 | 26 | - **`table_names`** (string, optional): Filters by a comma-separated list of 27 | names. By default, it lists all tables in user schemas. Default: `""`. 28 | - **`output_format`** (string, optional): Indicate the output format of table 29 | schema. `simple` will return only the table names, `detailed` will return the 30 | full table information. Default: `detailed`. 31 | 32 | ## Example 33 | 34 | ```yaml 35 | tools: 36 | mssql_list_tables: 37 | kind: mssql-list-tables 38 | source: mssql-source 39 | description: Use this tool to retrieve schema information for all or specified tables. Output format can be simple (only table names) or detailed. 40 | ``` 41 | 42 | ## Reference 43 | 44 | | **field** | **type** | **required** | **description** | 45 | |-------------|:--------:|:------------:|------------------------------------------------------| 46 | | kind | string | true | Must be "mssql-list-tables". | 47 | | source | string | true | Name of the source the SQL should execute on. | 48 | | description | string | true | Description of the tool that is passed to the agent. | 49 | ``` -------------------------------------------------------------------------------- /internal/sources/sqlite/sqlite_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package sqlite_test 16 | 17 | import ( 18 | "testing" 19 | 20 | yaml "github.com/goccy/go-yaml" 21 | "github.com/google/go-cmp/cmp" 22 | "github.com/googleapis/genai-toolbox/internal/server" 23 | "github.com/googleapis/genai-toolbox/internal/sources" 24 | "github.com/googleapis/genai-toolbox/internal/sources/sqlite" 25 | "github.com/googleapis/genai-toolbox/internal/testutils" 26 | ) 27 | 28 | func TestParseFromYamlSQLite(t *testing.T) { 29 | tcs := []struct { 30 | desc string 31 | in string 32 | want server.SourceConfigs 33 | }{ 34 | { 35 | desc: "basic example", 36 | in: ` 37 | sources: 38 | my-sqlite-db: 39 | kind: sqlite 40 | database: /path/to/database.db 41 | `, 42 | want: map[string]sources.SourceConfig{ 43 | "my-sqlite-db": sqlite.Config{ 44 | Name: "my-sqlite-db", 45 | Kind: sqlite.SourceKind, 46 | Database: "/path/to/database.db", 47 | }, 48 | }, 49 | }, 50 | } 51 | for _, tc := range tcs { 52 | t.Run(tc.desc, func(t *testing.T) { 53 | got := struct { 54 | Sources server.SourceConfigs `yaml:"sources"` 55 | }{} 56 | // Parse contents 57 | err := yaml.Unmarshal(testutils.FormatYaml(tc.in), &got) 58 | if err != nil { 59 | t.Fatalf("unable to unmarshal: %s", err) 60 | } 61 | if !cmp.Equal(tc.want, got.Sources) { 62 | t.Fatalf("incorrect parse: want %v, got %v", tc.want, got.Sources) 63 | } 64 | }) 65 | } 66 | } 67 | ``` -------------------------------------------------------------------------------- /.ci/generate_release_table.sh: -------------------------------------------------------------------------------- ```bash 1 | #! /bin/bash 2 | 3 | 4 | # Check if VERSION has been set 5 | if [ -z "${VERSION}" ]; then 6 | echo "Error: VERSION env var is not set" >&2 # Print to stderr 7 | exit 1 # Exit with a non-zero status to indicate an error 8 | fi 9 | 10 | 11 | FILES=("linux.amd64" "darwin.arm64" "darwin.amd64" "windows.amd64") 12 | output_string="" 13 | 14 | # Define the descriptions - ensure this array's order matches FILES 15 | DESCRIPTIONS=( 16 | "For **Linux** systems running on **Intel/AMD 64-bit processors**." 17 | "For **macOS** systems running on **Apple Silicon** (M1, M2, M3, etc.) processors." 18 | "For **macOS** systems running on **Intel processors**." 19 | "For **Windows** systems running on **Intel/AMD 64-bit processors**." 20 | ) 21 | 22 | # Write the table header 23 | ROW_FMT="| %-105s | %-120s | %-67s |\n" 24 | output_string+=$(printf "$ROW_FMT" "**OS/Architecture**" "**Description**" "**SHA256 Hash**")$'\n' 25 | output_string+=$(printf "$ROW_FMT" "$(printf -- '-%0.s' {1..105})" "$(printf -- '-%0.s' {1..120})" "$(printf -- '-%0.s' {1..67})")$'\n' 26 | 27 | 28 | # Loop through all files matching the pattern "toolbox.*.*" 29 | for i in "${!FILES[@]}" 30 | do 31 | file_key="${FILES[$i]}" # e.g., "linux.amd64" 32 | description_text="${DESCRIPTIONS[$i]}" 33 | 34 | # Extract OS and ARCH from the filename 35 | OS=$(echo "$file_key" | cut -d '.' -f 1) 36 | ARCH=$(echo "$file_key" | cut -d '.' -f 2) 37 | 38 | # Get release URL 39 | if [ "$OS" = 'windows' ]; 40 | then 41 | URL="https://storage.googleapis.com/genai-toolbox/$VERSION/$OS/$ARCH/toolbox.exe" 42 | else 43 | URL="https://storage.googleapis.com/genai-toolbox/$VERSION/$OS/$ARCH/toolbox" 44 | fi 45 | 46 | curl "$URL" --fail --output toolbox || exit 1 47 | 48 | # Calculate the SHA256 checksum of the file 49 | SHA256=$(shasum -a 256 toolbox | awk '{print $1}') 50 | 51 | # Write the table row 52 | output_string+=$(printf "$ROW_FMT" "[$OS/$ARCH]($URL)" "$description_text" "$SHA256")$'\n' 53 | 54 | rm toolbox 55 | done 56 | 57 | printf "$output_string\n" 58 | 59 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/postgres/postgres-list-tables.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "postgres-list-tables" 3 | type: docs 4 | weight: 1 5 | description: > 6 | The "postgres-list-tables" tool lists schema information for all or specified 7 | tables in a Postgres database. 8 | aliases: 9 | - /resources/tools/postgres-list-tables 10 | --- 11 | 12 | ## About 13 | 14 | The `postgres-list-tables` tool retrieves schema information for all or 15 | specified tables in a Postgres database. It's compatible with any of the 16 | following sources: 17 | 18 | - [alloydb-postgres](../../sources/alloydb-pg.md) 19 | - [cloud-sql-postgres](../../sources/cloud-sql-pg.md) 20 | - [postgres](../../sources/postgres.md) 21 | 22 | `postgres-list-tables` lists detailed schema information (object type, columns, 23 | constraints, indexes, triggers, owner, comment) as JSON for user-created tables 24 | (ordinary or partitioned). The tool takes the following input parameters: * 25 | `table_names` (optional): Filters by a comma-separated list of names. By 26 | default, it lists all tables in user schemas.* `output_format` (optional): 27 | Indicate the output format of table schema. `simple` will return only the 28 | table names, `detailed` will return the full table information. Default: 29 | `detailed`. 30 | 31 | ## Example 32 | 33 | ```yaml 34 | tools: 35 | postgres_list_tables: 36 | kind: postgres-list-tables 37 | source: postgres-source 38 | description: Use this tool to retrieve schema information for all or 39 | specified tables. Output format can be simple (only table names) or detailed. 40 | ``` 41 | 42 | ## Reference 43 | 44 | | **field** | **type** | **required** | **description** | 45 | |-------------|:--------:|:------------:|------------------------------------------------------| 46 | | kind | string | true | Must be "postgres-list-tables". | 47 | | source | string | true | Name of the source the SQL should execute on. | 48 | | description | string | true | Description of the tool that is passed to the agent. | 49 | ``` -------------------------------------------------------------------------------- /internal/tools/clickhouse/clickhouseexecutesql/clickhouseexecutesql_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package clickhouse 16 | 17 | import ( 18 | "testing" 19 | 20 | yaml "github.com/goccy/go-yaml" 21 | "github.com/google/go-cmp/cmp" 22 | "github.com/googleapis/genai-toolbox/internal/server" 23 | "github.com/googleapis/genai-toolbox/internal/testutils" 24 | ) 25 | 26 | func TestParseFromYamlClickHouseExecuteSQL(t *testing.T) { 27 | ctx, err := testutils.ContextWithNewLogger() 28 | if err != nil { 29 | t.Fatalf("unexpected error: %s", err) 30 | } 31 | tcs := []struct { 32 | desc string 33 | in string 34 | want server.ToolConfigs 35 | }{ 36 | { 37 | desc: "basic example", 38 | in: ` 39 | tools: 40 | example_tool: 41 | kind: clickhouse-execute-sql 42 | source: my-instance 43 | description: some description 44 | `, 45 | want: server.ToolConfigs{ 46 | "example_tool": Config{ 47 | Name: "example_tool", 48 | Kind: "clickhouse-execute-sql", 49 | Source: "my-instance", 50 | Description: "some description", 51 | AuthRequired: []string{}, 52 | }, 53 | }, 54 | }, 55 | } 56 | for _, tc := range tcs { 57 | t.Run(tc.desc, func(t *testing.T) { 58 | got := struct { 59 | Tools server.ToolConfigs `yaml:"tools"` 60 | }{} 61 | err := yaml.UnmarshalContext(ctx, testutils.FormatYaml(tc.in), &got) 62 | if err != nil { 63 | t.Fatalf("unable to unmarshal: %s", err) 64 | } 65 | if diff := cmp.Diff(tc.want, got.Tools); diff != "" { 66 | t.Fatalf("incorrect parse: diff %v", diff) 67 | } 68 | }) 69 | } 70 | } 71 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/alloydb/alloydb-list-clusters.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: alloydb-list-clusters 3 | type: docs 4 | weight: 1 5 | description: "The \"alloydb-list-clusters\" tool lists the AlloyDB clusters in a given project and location.\n" 6 | aliases: [/resources/tools/alloydb-list-clusters] 7 | --- 8 | 9 | ## About 10 | 11 | The `alloydb-list-clusters` tool retrieves AlloyDB cluster information for all 12 | or specified locations in a given project. It is compatible with 13 | [alloydb-admin](../../sources/alloydb-admin.md) source. 14 | 15 | `alloydb-list-clusters` tool lists the detailed information of AlloyDB 16 | cluster(cluster name, state, configuration, etc) for a given project and 17 | location. The tool takes the following input parameters: 18 | 19 | | Parameter | Type | Description | Required | 20 | | :--------- | :----- | :----------------------------------------------------------------------------------------------- | :------- | 21 | | `project` | string | The GCP project ID to list clusters for. | Yes | 22 | | `location` | string | The location to list clusters in (e.g., 'us-central1'). Use `-` for all locations. Default: `-`. | No | 23 | 24 | ## Example 25 | 26 | ```yaml 27 | tools: 28 | list_clusters: 29 | kind: alloydb-list-clusters 30 | source: alloydb-admin-source 31 | description: Use this tool to list all AlloyDB clusters in a given project and location. 32 | ``` 33 | 34 | ## Reference 35 | 36 | | **field** | **type** | **required** | **description** | 37 | | ----------- | :------: | :----------: | ---------------------------------------------------- | 38 | | kind | string | true | Must be alloydb-list-clusters. | 39 | | source | string | true | The name of an `alloydb-admin` source. | 40 | | description | string | false | Description of the tool that is passed to the agent. | 41 | ``` -------------------------------------------------------------------------------- /internal/prebuiltconfigs/tools/looker-conversational-analytics.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | sources: 16 | looker-source: 17 | kind: looker 18 | base_url: ${LOOKER_BASE_URL} 19 | client_id: ${LOOKER_CLIENT_ID:} 20 | client_secret: ${LOOKER_CLIENT_SECRET:} 21 | verify_ssl: ${LOOKER_VERIFY_SSL:true} 22 | timeout: 600s 23 | use_client_oauth: ${LOOKER_USE_CLIENT_OAUTH:false} 24 | project: ${LOOKER_PROJECT:} 25 | location: ${LOOKER_LOCATION:} 26 | 27 | tools: 28 | ask_data_insights: 29 | kind: looker-conversational-analytics 30 | source: looker-source 31 | description: | 32 | Use this tool to perform data analysis, get insights, 33 | or answer complex questions about the contents of specific 34 | Looker explores. 35 | 36 | get_models: 37 | kind: looker-get-models 38 | source: looker-source 39 | description: | 40 | The get_models tool retrieves the list of LookML models in the Looker system. 41 | 42 | It takes no parameters. 43 | 44 | get_explores: 45 | kind: looker-get-explores 46 | source: looker-source 47 | description: | 48 | The get_explores tool retrieves the list of explores defined in a LookML model 49 | in the Looker system. 50 | 51 | It takes one parameter, the model_name looked up from get_models. 52 | 53 | toolsets: 54 | looker_conversational_analytics_tools: 55 | - ask_data_insights 56 | - get_models 57 | - get_explores ``` -------------------------------------------------------------------------------- /internal/tools/toolsets.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2024 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package tools 16 | 17 | import ( 18 | "fmt" 19 | ) 20 | 21 | type ToolsetConfig struct { 22 | Name string `yaml:"name"` 23 | ToolNames []string `yaml:",inline"` 24 | } 25 | 26 | type Toolset struct { 27 | Name string `yaml:"name"` 28 | Tools []*Tool `yaml:",inline"` 29 | Manifest ToolsetManifest `yaml:",inline"` 30 | McpManifest []McpManifest `yaml:",inline"` 31 | } 32 | 33 | type ToolsetManifest struct { 34 | ServerVersion string `json:"serverVersion"` 35 | ToolsManifest map[string]Manifest `json:"tools"` 36 | } 37 | 38 | func (t ToolsetConfig) Initialize(serverVersion string, toolsMap map[string]Tool) (Toolset, error) { 39 | // finish toolset setup 40 | // Check each declared tool name exists 41 | var toolset Toolset 42 | toolset.Name = t.Name 43 | if !IsValidName(toolset.Name) { 44 | return toolset, fmt.Errorf("invalid toolset name: %s", t) 45 | } 46 | toolset.Tools = make([]*Tool, len(t.ToolNames)) 47 | toolset.Manifest = ToolsetManifest{ 48 | ServerVersion: serverVersion, 49 | ToolsManifest: make(map[string]Manifest), 50 | } 51 | for _, toolName := range t.ToolNames { 52 | tool, ok := toolsMap[toolName] 53 | if !ok { 54 | return toolset, fmt.Errorf("tool does not exist: %s", t) 55 | } 56 | toolset.Tools = append(toolset.Tools, &tool) 57 | toolset.Manifest.ToolsManifest[toolName] = tool.Manifest() 58 | toolset.McpManifest = append(toolset.McpManifest, tool.McpManifest()) 59 | } 60 | 61 | return toolset, nil 62 | } 63 | ``` -------------------------------------------------------------------------------- /internal/tools/cloudsql/cloudsqllistinstances/cloudsqllistinstances_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package cloudsqllistinstances 16 | 17 | import ( 18 | "testing" 19 | 20 | "github.com/goccy/go-yaml" 21 | "github.com/google/go-cmp/cmp" 22 | "github.com/googleapis/genai-toolbox/internal/server" 23 | "github.com/googleapis/genai-toolbox/internal/testutils" 24 | ) 25 | 26 | func TestParseFromYaml(t *testing.T) { 27 | ctx, err := testutils.ContextWithNewLogger() 28 | if err != nil { 29 | t.Fatalf("unexpected error: %s", err) 30 | } 31 | tcs := []struct { 32 | desc string 33 | in string 34 | want server.ToolConfigs 35 | }{ 36 | { 37 | desc: "basic example", 38 | in: ` 39 | tools: 40 | list-my-instances: 41 | kind: cloud-sql-list-instances 42 | description: some description 43 | source: some-source 44 | `, 45 | want: server.ToolConfigs{ 46 | "list-my-instances": Config{ 47 | Name: "list-my-instances", 48 | Kind: "cloud-sql-list-instances", 49 | Description: "some description", 50 | AuthRequired: []string{}, 51 | Source: "some-source", 52 | }, 53 | }, 54 | }, 55 | } 56 | for _, tc := range tcs { 57 | t.Run(tc.desc, func(t *testing.T) { 58 | got := struct { 59 | Tools server.ToolConfigs `yaml:"tools"` 60 | }{} 61 | // Parse contents 62 | err := yaml.UnmarshalContext(ctx, testutils.FormatYaml(tc.in), &got) 63 | if err != nil { 64 | t.Fatalf("unable to unmarshal: %s", err) 65 | } 66 | if diff := cmp.Diff(tc.want, got.Tools); diff != "" { 67 | t.Fatalf("incorrect parse: diff %v", diff) 68 | } 69 | }) 70 | } 71 | } 72 | ``` -------------------------------------------------------------------------------- /internal/tools/dataform/dataformcompilelocal/dataformcompilelocal_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package dataformcompilelocal_test 16 | 17 | import ( 18 | "testing" 19 | 20 | yaml "github.com/goccy/go-yaml" 21 | "github.com/google/go-cmp/cmp" 22 | "github.com/googleapis/genai-toolbox/internal/server" 23 | "github.com/googleapis/genai-toolbox/internal/testutils" 24 | "github.com/googleapis/genai-toolbox/internal/tools/dataform/dataformcompilelocal" 25 | ) 26 | 27 | func TestParseFromYamlDataformCompile(t *testing.T) { 28 | ctx, err := testutils.ContextWithNewLogger() 29 | if err != nil { 30 | t.Fatalf("unexpected error: %s", err) 31 | } 32 | tcs := []struct { 33 | desc string 34 | in string 35 | want server.ToolConfigs 36 | }{ 37 | { 38 | desc: "basic example", 39 | in: ` 40 | tools: 41 | example_tool: 42 | kind: dataform-compile-local 43 | description: some description 44 | `, 45 | want: server.ToolConfigs{ 46 | "example_tool": dataformcompilelocal.Config{ 47 | Name: "example_tool", 48 | Kind: "dataform-compile-local", 49 | Description: "some description", 50 | AuthRequired: []string{}, 51 | }, 52 | }, 53 | }, 54 | } 55 | for _, tc := range tcs { 56 | t.Run(tc.desc, func(t *testing.T) { 57 | got := struct { 58 | Tools server.ToolConfigs `yaml:"tools"` 59 | }{} 60 | // Parse contents 61 | err := yaml.UnmarshalContext(ctx, testutils.FormatYaml(tc.in), &got) 62 | if err != nil { 63 | t.Fatalf("unable to unmarshal: %s", err) 64 | } 65 | if diff := cmp.Diff(tc.want, got.Tools); diff != "" { 66 | t.Fatalf("incorrect parse: diff %v", diff) 67 | } 68 | }) 69 | } 70 | 71 | } 72 | ``` -------------------------------------------------------------------------------- /.github/workflows/docs_preview_clean.yaml: -------------------------------------------------------------------------------- ```yaml 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: "docs" 16 | 17 | permissions: 18 | contents: write 19 | pull-requests: write 20 | 21 | # This Workflow depends on 'github.event.number', 22 | # not compatible with branch or manual triggers. 23 | on: 24 | pull_request: 25 | types: 26 | - closed 27 | 28 | jobs: 29 | clean: 30 | if: ${{ !github.event.pull_request.head.repo.fork }} 31 | runs-on: ubuntu-24.04 32 | concurrency: 33 | # Shared concurrency group wih preview staging. 34 | group: "preview-${{ github.event.number }}" 35 | cancel-in-progress: true 36 | steps: 37 | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 38 | with: 39 | ref: versioned-gh-pages 40 | 41 | - name: Remove Preview 42 | run: | 43 | rm -Rf ./previews/PR-${{ github.event.number }} 44 | git config user.name 'github-actions[bot]' 45 | git config user.email 'github-actions[bot]@users.noreply.github.com' 46 | git add -u previews/PR-${{ github.event.number }} 47 | git commit --message "cleanup: previews/PR-${{ github.event.number }}" 48 | git push 49 | 50 | - name: Comment 51 | uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 52 | with: 53 | script: | 54 | github.rest.issues.createComment({ 55 | issue_number: context.payload.number, 56 | owner: context.repo.owner, 57 | repo: context.repo.repo, 58 | body: "🧨 Preview deployments removed." 59 | }) 60 | ``` -------------------------------------------------------------------------------- /docs/en/resources/authServices/google.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "Google Sign-In" 3 | type: docs 4 | weight: 1 5 | description: > 6 | Use Google Sign-In for Oauth 2.0 flow and token lifecycle. 7 | --- 8 | 9 | ## Getting Started 10 | 11 | Google Sign-In manages the OAuth 2.0 flow and token lifecycle. To integrate the 12 | Google Sign-In workflow to your web app [follow this guide][gsi-setup]. 13 | 14 | After setting up the Google Sign-In workflow, you should have registered your 15 | application and retrieved a [Client ID][client-id]. Configure your auth service 16 | in with the `Client ID`. 17 | 18 | [gsi-setup]: https://developers.google.com/identity/sign-in/web/sign-in 19 | [client-id]: https://developers.google.com/identity/sign-in/web/sign-in#create_authorization_credentials 20 | 21 | ## Behavior 22 | 23 | ### Authorized Invocations 24 | 25 | When using [Authorized Invocations][auth-invoke], a tool will be 26 | considered authorized if it has a valid Oauth 2.0 token that matches the Client 27 | ID. 28 | 29 | [auth-invoke]: ../tools/#authorized-invocations 30 | 31 | ### Authenticated Parameters 32 | 33 | When using [Authenticated Parameters][auth-params], any [claim provided by the 34 | id-token][provided-claims] can be used for the parameter. 35 | 36 | [auth-params]: ../tools/#authenticated-parameters 37 | [provided-claims]: 38 | https://developers.google.com/identity/openid-connect/openid-connect#obtaininguserprofileinformation 39 | 40 | ## Example 41 | 42 | ```yaml 43 | authServices: 44 | my-google-auth: 45 | kind: google 46 | clientId: ${YOUR_GOOGLE_CLIENT_ID} 47 | ``` 48 | 49 | {{< notice tip >}} 50 | Use environment variable replacement with the format ${ENV_NAME} 51 | instead of hardcoding your secrets into the configuration file. 52 | {{< /notice >}} 53 | 54 | ## Reference 55 | 56 | | **field** | **type** | **required** | **description** | 57 | |-----------|:--------:|:------------:|------------------------------------------------------------------| 58 | | kind | string | true | Must be "google". | 59 | | clientId | string | true | Client ID of your application from registering your application. | 60 | ``` -------------------------------------------------------------------------------- /docs/en/getting-started/quickstart/python/langchain/quickstart.py: -------------------------------------------------------------------------------- ```python 1 | import asyncio 2 | 3 | from langgraph.prebuilt import create_react_agent 4 | 5 | # TODO(developer): replace this with another import if needed 6 | 7 | from langchain_google_vertexai import ChatVertexAI 8 | 9 | # from langchain_google_genai import ChatGoogleGenerativeAI 10 | 11 | # from langchain_anthropic import ChatAnthropic 12 | 13 | from langgraph.checkpoint.memory import MemorySaver 14 | 15 | from toolbox_langchain import ToolboxClient 16 | 17 | prompt = """ 18 | You're a helpful hotel assistant. You handle hotel searching, booking and 19 | cancellations. When the user searches for a hotel, mention it's name, id, 20 | location and price tier. Always mention hotel ids while performing any 21 | searches. This is very important for any operations. For any bookings or 22 | cancellations, please provide the appropriate confirmation. Be sure to 23 | update checkin or checkout dates if mentioned by the user. 24 | Don't ask for confirmations from the user. 25 | """ 26 | 27 | queries = [ 28 | "Find hotels in Basel with Basel in its name.", 29 | "Can you book the Hilton Basel for me?", 30 | "Oh wait, this is too expensive. Please cancel it and book the Hyatt Regency instead.", 31 | "My check in dates would be from April 10, 2024 to April 19, 2024.", 32 | ] 33 | 34 | async def main(): 35 | # TODO(developer): replace this with another model if needed 36 | model = ChatVertexAI(model_name="gemini-2.0-flash-001") 37 | # model = ChatGoogleGenerativeAI(model="gemini-2.0-flash-001") 38 | # model = ChatAnthropic(model="claude-3-5-sonnet-20240620") 39 | 40 | # Load the tools from the Toolbox server 41 | async with ToolboxClient("http://127.0.0.1:5000") as client: 42 | tools = await client.aload_toolset() 43 | 44 | agent = create_react_agent(model, tools, checkpointer=MemorySaver()) 45 | 46 | config = {"configurable": {"thread_id": "thread-1"}} 47 | for query in queries: 48 | inputs = {"messages": [("user", prompt + query)]} 49 | response = agent.invoke(inputs, stream_mode="values", config=config) 50 | print(response["messages"][-1].content) 51 | 52 | asyncio.run(main()) 53 | ``` -------------------------------------------------------------------------------- /internal/tools/utility/wait/wait_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package wait_test 16 | 17 | import ( 18 | "testing" 19 | 20 | yaml "github.com/goccy/go-yaml" 21 | "github.com/google/go-cmp/cmp" 22 | "github.com/googleapis/genai-toolbox/internal/server" 23 | "github.com/googleapis/genai-toolbox/internal/testutils" 24 | 25 | wait "github.com/googleapis/genai-toolbox/internal/tools/utility/wait" 26 | ) 27 | 28 | func TestParseFromYamlWait(t *testing.T) { 29 | ctx, err := testutils.ContextWithNewLogger() 30 | if err != nil { 31 | t.Fatalf("unexpected error: %s", err) 32 | } 33 | tcs := []struct { 34 | desc string 35 | in string 36 | want server.ToolConfigs 37 | }{ 38 | { 39 | desc: "basic example", 40 | in: ` 41 | tools: 42 | example_tool: 43 | kind: wait 44 | description: some description 45 | timeout: 10s 46 | authRequired: 47 | - my-google-auth-service 48 | `, 49 | want: server.ToolConfigs{ 50 | "example_tool": wait.Config{ 51 | Name: "example_tool", 52 | Kind: "wait", 53 | Description: "some description", 54 | Timeout: "10s", 55 | AuthRequired: []string{"my-google-auth-service"}, 56 | }, 57 | }, 58 | }, 59 | } 60 | for _, tc := range tcs { 61 | t.Run(tc.desc, func(t *testing.T) { 62 | got := struct { 63 | Tools server.ToolConfigs `yaml:"tools"` 64 | }{} 65 | // Parse contents 66 | err := yaml.UnmarshalContext(ctx, testutils.FormatYaml(tc.in), &got) 67 | if err != nil { 68 | t.Fatalf("unable to unmarshal: %s", err) 69 | } 70 | if diff := cmp.Diff(tc.want, got.Tools); diff != "" { 71 | t.Fatalf("incorrect parse: diff %v", diff) 72 | } 73 | }) 74 | } 75 | } 76 | ``` -------------------------------------------------------------------------------- /internal/tools/cloudsql/cloudsqlcreateusers/cloudsqlcreateusers_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package cloudsqlcreateusers_test 16 | 17 | import ( 18 | "testing" 19 | 20 | "github.com/goccy/go-yaml" 21 | "github.com/google/go-cmp/cmp" 22 | "github.com/googleapis/genai-toolbox/internal/server" 23 | "github.com/googleapis/genai-toolbox/internal/testutils" 24 | "github.com/googleapis/genai-toolbox/internal/tools/cloudsql/cloudsqlcreateusers" 25 | ) 26 | 27 | func TestParseFromYaml(t *testing.T) { 28 | ctx, err := testutils.ContextWithNewLogger() 29 | if err != nil { 30 | t.Fatalf("unexpected error: %s", err) 31 | } 32 | tcs := []struct { 33 | desc string 34 | in string 35 | want server.ToolConfigs 36 | }{ 37 | { 38 | desc: "basic example", 39 | in: ` 40 | tools: 41 | create-user: 42 | kind: cloud-sql-create-users 43 | source: my-source 44 | description: some description 45 | `, 46 | want: server.ToolConfigs{ 47 | "create-user": cloudsqlcreateusers.Config{ 48 | Name: "create-user", 49 | Kind: "cloud-sql-create-users", 50 | Source: "my-source", 51 | Description: "some description", 52 | AuthRequired: []string{}, 53 | }, 54 | }, 55 | }, 56 | } 57 | for _, tc := range tcs { 58 | t.Run(tc.desc, func(t *testing.T) { 59 | got := struct { 60 | Tools server.ToolConfigs `yaml:"tools"` 61 | }{} 62 | // Parse contents 63 | err := yaml.UnmarshalContext(ctx, testutils.FormatYaml(tc.in), &got) 64 | if err != nil { 65 | t.Fatalf("unable to unmarshal: %s", err) 66 | } 67 | if diff := cmp.Diff(tc.want, got.Tools); diff != "" { 68 | t.Fatalf("incorrect parse: diff %v", diff) 69 | } 70 | }) 71 | } 72 | } 73 | ``` -------------------------------------------------------------------------------- /docs/en/resources/sources/neo4j.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "Neo4j" 3 | type: docs 4 | weight: 1 5 | description: > 6 | Neo4j is a powerful, open source graph database system 7 | 8 | --- 9 | 10 | ## About 11 | 12 | [Neo4j][neo4j-docs] is a powerful, open source graph database system with over 13 | 15 years of active development that has earned it a strong reputation for 14 | reliability, feature robustness, and performance. 15 | 16 | [neo4j-docs]: https://neo4j.com/docs 17 | 18 | ## Available Tools 19 | 20 | - [`neo4j-cypher`](../tools/neo4j/neo4j-cypher.md) 21 | Run Cypher queries against your Neo4j graph database. 22 | 23 | ## Requirements 24 | 25 | ### Database User 26 | 27 | This source only uses standard authentication. You will need to [create a Neo4j 28 | user][neo4j-users] to log in to the database with, or use the default `neo4j` 29 | user if available. 30 | 31 | [neo4j-users]: https://neo4j.com/docs/operations-manual/current/authentication-authorization/manage-users/ 32 | 33 | ## Example 34 | 35 | ```yaml 36 | sources: 37 | my-neo4j-source: 38 | kind: neo4j 39 | uri: neo4j+s://xxxx.databases.neo4j.io:7687 40 | user: ${USER_NAME} 41 | password: ${PASSWORD} 42 | database: "neo4j" 43 | ``` 44 | 45 | {{< notice tip >}} 46 | Use environment variable replacement with the format ${ENV_NAME} 47 | instead of hardcoding your secrets into the configuration file. 48 | {{< /notice >}} 49 | 50 | ## Reference 51 | 52 | | **field** | **type** | **required** | **description** | 53 | |-----------|:--------:|:------------:|----------------------------------------------------------------------| 54 | | kind | string | true | Must be "neo4j". | 55 | | uri | string | true | Connect URI ("bolt://localhost", "neo4j+s://xxx.databases.neo4j.io") | 56 | | user | string | true | Name of the Neo4j user to connect as (e.g. "neo4j"). | 57 | | password | string | true | Password of the Neo4j user (e.g. "my-password"). | 58 | | database | string | true | Name of the Neo4j database to connect to (e.g. "neo4j"). | 59 | ``` -------------------------------------------------------------------------------- /internal/tools/bigquery/bigqueryforecast/bigqueryforecast_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package bigqueryforecast_test 16 | 17 | import ( 18 | "testing" 19 | 20 | yaml "github.com/goccy/go-yaml" 21 | "github.com/google/go-cmp/cmp" 22 | "github.com/googleapis/genai-toolbox/internal/server" 23 | "github.com/googleapis/genai-toolbox/internal/testutils" 24 | "github.com/googleapis/genai-toolbox/internal/tools/bigquery/bigqueryforecast" 25 | ) 26 | 27 | func TestParseFromYamlBigQueryForecast(t *testing.T) { 28 | ctx, err := testutils.ContextWithNewLogger() 29 | if err != nil { 30 | t.Fatalf("unexpected error: %s", err) 31 | } 32 | tcs := []struct { 33 | desc string 34 | in string 35 | want server.ToolConfigs 36 | }{ 37 | { 38 | desc: "basic example", 39 | in: ` 40 | tools: 41 | example_tool: 42 | kind: bigquery-forecast 43 | source: my-instance 44 | description: some description 45 | `, 46 | want: server.ToolConfigs{ 47 | "example_tool": bigqueryforecast.Config{ 48 | Name: "example_tool", 49 | Kind: "bigquery-forecast", 50 | Source: "my-instance", 51 | Description: "some description", 52 | AuthRequired: []string{}, 53 | }, 54 | }, 55 | }, 56 | } 57 | for _, tc := range tcs { 58 | t.Run(tc.desc, func(t *testing.T) { 59 | got := struct { 60 | Tools server.ToolConfigs `yaml:"tools"` 61 | }{} 62 | // Parse contents 63 | err := yaml.UnmarshalContext(ctx, testutils.FormatYaml(tc.in), &got) 64 | if err != nil { 65 | t.Fatalf("unable to unmarshal: %s", err) 66 | } 67 | if diff := cmp.Diff(tc.want, got.Tools); diff != "" { 68 | t.Fatalf("incorrect parse: diff %v", diff) 69 | } 70 | }) 71 | } 72 | 73 | } 74 | ``` -------------------------------------------------------------------------------- /docs/en/resources/tools/mysql/mysql-list-tables-missing-unique-indexes.md: -------------------------------------------------------------------------------- ```markdown 1 | --- 2 | title: "mysql-list-tables-missing-unique-indexes" 3 | type: docs 4 | weight: 1 5 | description: > 6 | A "mysql-list-tables-missing-unique-indexes" tool lists tables that do not have primary or unique indices in a MySQL instance. 7 | aliases: 8 | - /resources/tools/mysql-list-tables-missing-unique-indexes 9 | --- 10 | 11 | ## About 12 | 13 | A `mysql-list-tables-missing-unique-indexes` tool searches tables that do not 14 | have primary or unique indices in a MySQL database. It's compatible with: 15 | 16 | - [cloud-sql-mysql](../../sources/cloud-sql-mysql.md) 17 | - [mysql](../../sources/mysql.md) 18 | 19 | `mysql-list-tables-missing-unique-indexes` outputs table names, including 20 | `table_schema` and `table_name` in JSON format. It takes 2 optional input 21 | parameters: 22 | 23 | - `table_schema` (optional): Only check tables in this specific schema/database. 24 | Search all visible tables in all visible databases if not specified. 25 | - `limit` (optional): max number of queries to return, default `50`. 26 | 27 | ## Example 28 | 29 | ```yaml 30 | tools: 31 | list_tables_missing_unique_indexes: 32 | kind: mysql-list-tables-missing-unique-indexes 33 | source: my-mysql-instance 34 | description: Find tables that do not have primary or unique key constraint. A primary key or unique key is the only mechanism that guaranttes a row is unique. Without them, the database-level protection against data integrity issues will be missing. 35 | ``` 36 | The response is a json array with the following fields: 37 | ```json 38 | { 39 | "table_schema": "the schema/database this table belongs to", 40 | "table_name": "name of the table", 41 | } 42 | ``` 43 | 44 | ## Reference 45 | 46 | | **field** | **type** | **required** | **description** | 47 | |-------------|:--------:|:------------:|----------------------------------------------------| 48 | | kind | string | true | Must be "mysql-list-active-queries". | 49 | | source | string | true | Name of the source the SQL should execute on. | 50 | | description | string | true | Description of the tool that is passed to the LLM. | 51 | ``` -------------------------------------------------------------------------------- /internal/tools/bigquery/bigqueryexecutesql/bigqueryexecutesql_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package bigqueryexecutesql_test 16 | 17 | import ( 18 | "testing" 19 | 20 | yaml "github.com/goccy/go-yaml" 21 | "github.com/google/go-cmp/cmp" 22 | "github.com/googleapis/genai-toolbox/internal/server" 23 | "github.com/googleapis/genai-toolbox/internal/testutils" 24 | "github.com/googleapis/genai-toolbox/internal/tools/bigquery/bigqueryexecutesql" 25 | ) 26 | 27 | func TestParseFromYamlBigQueryExecuteSql(t *testing.T) { 28 | ctx, err := testutils.ContextWithNewLogger() 29 | if err != nil { 30 | t.Fatalf("unexpected error: %s", err) 31 | } 32 | tcs := []struct { 33 | desc string 34 | in string 35 | want server.ToolConfigs 36 | }{ 37 | { 38 | desc: "basic example", 39 | in: ` 40 | tools: 41 | example_tool: 42 | kind: bigquery-execute-sql 43 | source: my-instance 44 | description: some description 45 | `, 46 | want: server.ToolConfigs{ 47 | "example_tool": bigqueryexecutesql.Config{ 48 | Name: "example_tool", 49 | Kind: "bigquery-execute-sql", 50 | Source: "my-instance", 51 | Description: "some description", 52 | AuthRequired: []string{}, 53 | }, 54 | }, 55 | }, 56 | } 57 | for _, tc := range tcs { 58 | t.Run(tc.desc, func(t *testing.T) { 59 | got := struct { 60 | Tools server.ToolConfigs `yaml:"tools"` 61 | }{} 62 | // Parse contents 63 | err := yaml.UnmarshalContext(ctx, testutils.FormatYaml(tc.in), &got) 64 | if err != nil { 65 | t.Fatalf("unable to unmarshal: %s", err) 66 | } 67 | if diff := cmp.Diff(tc.want, got.Tools); diff != "" { 68 | t.Fatalf("incorrect parse: diff %v", diff) 69 | } 70 | }) 71 | } 72 | 73 | } 74 | ``` -------------------------------------------------------------------------------- /internal/tools/cloudsql/cloudsqlcreatedatabase/cloudsqlcreatedatabase_test.go: -------------------------------------------------------------------------------- ```go 1 | // Copyright 2025 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package cloudsqlcreatedatabase_test 16 | 17 | import ( 18 | "testing" 19 | 20 | "github.com/goccy/go-yaml" 21 | "github.com/google/go-cmp/cmp" 22 | "github.com/googleapis/genai-toolbox/internal/server" 23 | "github.com/googleapis/genai-toolbox/internal/testutils" 24 | "github.com/googleapis/genai-toolbox/internal/tools/cloudsql/cloudsqlcreatedatabase" 25 | ) 26 | 27 | func TestParseFromYaml(t *testing.T) { 28 | ctx, err := testutils.ContextWithNewLogger() 29 | if err != nil { 30 | t.Fatalf("unexpected error: %s", err) 31 | } 32 | tcs := []struct { 33 | desc string 34 | in string 35 | want server.ToolConfigs 36 | }{ 37 | { 38 | desc: "basic example", 39 | in: ` 40 | tools: 41 | create-database: 42 | kind: cloud-sql-create-database 43 | source: my-source 44 | description: some description 45 | `, 46 | want: server.ToolConfigs{ 47 | "create-database": cloudsqlcreatedatabase.Config{ 48 | Name: "create-database", 49 | Kind: "cloud-sql-create-database", 50 | Source: "my-source", 51 | Description: "some description", 52 | AuthRequired: []string{}, 53 | }, 54 | }, 55 | }, 56 | } 57 | for _, tc := range tcs { 58 | t.Run(tc.desc, func(t *testing.T) { 59 | got := struct { 60 | Tools server.ToolConfigs `yaml:"tools"` 61 | }{} 62 | // Parse contents 63 | err := yaml.UnmarshalContext(ctx, testutils.FormatYaml(tc.in), &got) 64 | if err != nil { 65 | t.Fatalf("unable to unmarshal: %s", err) 66 | } 67 | if diff := cmp.Diff(tc.want, got.Tools); diff != "" { 68 | t.Fatalf("incorrect parse: diff %v", diff) 69 | } 70 | }) 71 | } 72 | } 73 | ```