Commit Graph

388 Commits

Author SHA1 Message Date
Yuan Teoh
62359deae5 chore(deps): update elasticsearch dependencies (#1955)
Update elastic search dependencies
2025-11-14 18:20:28 +00:00
Yuan Teoh
3ff8f533cf chore(deps): update otel dependencies (#1954)
Update OTEL semconv version.
2025-11-14 10:04:08 -08:00
Yuan Teoh
f6804420b9 chore: embed ToolsetConfig into Toolset (#1885)
To keep a persistent backend storage for configuration, we will have to
keep a single source of truth. This involves supporting bi-directional
conversion between ToolsetConfig and Toolset.


This PR make the following changes:
* Embed ToolsetConfig in Toolset
* Add `ToConfig()` to extract ToolsetConfig from Toolset.
2025-11-13 16:53:35 -08:00
Yuan Teoh
927881ffb9 chore: embed Config into Auth (#1865)
To keep a persistent backend storage for configuration, we will have to
keep a single source of truth. This involves supporting bi-directional
conversion between Config and AuthService.


This PR make the following changes:
* Embed Config in AuthService
* Add `ToConfig()` to extract Config from AuthService.
2025-11-13 16:37:23 -08:00
google-labs-jules[bot]
42c8dd7ddd chore: embed Config into Tool (#1875)
To keep a persistent backend storage for configuration, we will have to
keep a single source of truth. This involves supporting bi-directional
conversion between Config and Tool.


This PR make the following changes:
* Embed Config in Tool
* Add `ToConfig()` to extract Config from Tool.


Jules PR

---
*PR created automatically by Jules for task
[11947649751737965380](https://jules.google.com/task/11947649751737965380)*

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Yuan Teoh <yuanteoh@google.com>
2025-11-14 00:21:15 +00:00
Yuan Teoh
ae0c29254a chore: embed Config into Source (#1864)
To keep a persistent backend storage for configuration, we will have to
keep a single source of truth. This involves supporting bi-directional
conversion between Config and Source.


This PR make the following changes:
* Embed Config in Source
* Add `ToConfig()` to extract Config from Source.
2025-11-13 14:11:25 -08:00
Yuan Teoh
4aabb4aaca chore: move parameters to internal/util (#1907)
To facilitate the transition of moving invocation implementation to
Source, we will have to move parameter to `internal/util`. This approach
is crucial because certain parameters may not be fully resolvable
pre-implementation. Since both `internal/sources` and `internal/tools`
will need access to `parameters`, it will be more relevant to move
parameters implementation to utils.
2025-11-13 21:37:12 +00:00
Srividya Reddy
897c63dcea feat(tools): add list_indexes, list_sequences tools for postgres (#1765)
## Description

Adds the following tools for Postgres:
(1) list_indexes:  Lists available user indexes in a given database. 
(2) list_sequences: Lists all the sequences in the database ordered by
sequence name.

list_indexes:
<img width="1708" height="816" alt="Screenshot 2025-10-21 at 10 24
30 PM"
src="https://github.com/user-attachments/assets/d1888f53-6013-4beb-b0dc-b94f3d66135e"
/>

<img width="1914" height="1017" alt="Screenshot 2025-10-22 at 8 23
16 AM"
src="https://github.com/user-attachments/assets/7c185ef4-4550-4bb2-8051-0eca8f40dc7b"
/>

list_sequences:

<img width="2539" height="902" alt="Screenshot 2025-10-22 at 8 04 25 AM"
src="https://github.com/user-attachments/assets/f22cfaad-412b-4df2-99f3-ee813f538ff7"
/>

<img width="1082" height="610" alt="Screenshot 2025-10-22 at 8 06 07 AM"
src="https://github.com/user-attachments/assets/102ed3ca-33f6-409f-9ba1-363c9e15d5d3"
/>



> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1738
2025-11-13 21:17:03 +00:00
Luka Fontanilla
ef63860559 feat: adding generate embed url functionality (#1877)
## Description

> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

This PR adds a new tool to the Looker MCP Toolbox, that enables the user
authenticated to the Looker Source to generate authenticated embed urls
for dashboards, looks and queries. When combined with other tools that
already exist in the Looker toolbox, this enables searching existing
content and providing authenticated urls to them OR creating
authenticated urls from queries generated via Natural Language. The
embed urls will create an embed session for the user and can be opened
directly or added to an iframe `src` attribute to provide a smooth
Embedded Analytics setup.

Additionally this PR adds a new optional parameter to the Looker source
called `SessionLength` which an admin setting up the Looker source can
set to determine how long the Embed sessions last for.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ X] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ X] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ X] Code coverage does not decrease (if any source code was changed)
- [X ] Appropriate docs were updated (if necessary)
- [ X] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1876 https://github.com/googleapis/genai-toolbox/issues/1876

---------

Co-authored-by: Luka Fontanilla <maluka@google.com>
Co-authored-by: Dr. Strangelove <drstrangelove@google.com>
2025-11-13 19:15:39 +00:00
Srividya Reddy
a4c9287aec feat(tools/postgres): add list_triggers, database_overview tools for postgres (#1912)
## Description

Adds the following tools for Postgres:
(1) list_triggers: Lists triggers in the database. .
(2) database_overview: Fetches the current state of the PostgreSQL
server.

list_triggers:
<img width="1712" height="703" alt="Screenshot 2025-11-09 at 8 16 53 PM"
src="https://github.com/user-attachments/assets/1974e303-b559-4efc-b129-444ba97c7715"
/>

<img width="874" height="513" alt="Screenshot 2025-11-09 at 8 19 43 PM"
src="https://github.com/user-attachments/assets/59ddcd15-224b-4e9a-906d-ec2645835873"
/>

database_overview:

<img width="1521" height="683" alt="Screenshot 2025-11-09 at 8 53 03 PM"
src="https://github.com/user-attachments/assets/4ae86e74-aa78-410c-a9cc-f33ae3268fb6"
/>

<img width="850" height="241" alt="Screenshot 2025-11-09 at 8 49 53 PM"
src="https://github.com/user-attachments/assets/abae2c7a-5f3e-4433-86de-3606e3298ec5"
/>


> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1738
2025-11-12 14:35:23 -08:00
Niraj Nandre
2c228ef4f2 feat(tool/mysql): Set default host and port for MySQL source (#1922)
## Description

This pull request addresses issue
[#29](https://github.com/gemini-cli-extensions/mysql/issues/29) by
implementing default connection values for the MySQL data source. When a
user does not specify a host or port, the connection will now
automatically default to localhost:3306.

### Detailed Changes

1. **internal/prebuiltconfigs/tools/mysql.yaml**
- Added the default values to host and port.Specifically, they are now
host: ${MYSQL_HOST:localhost} and port: ${MYSQL_PORT:3306}.This allows
the configuration loader to directly use "localhost" or "3306" as a
fallback if the MYSQL_HOST or MYSQL_PORT environment variables are not
set.

**Testing and Validation**
To ensure the changes work correctly and are compatible with MySQL-like
databases, the feature was manually tested against a MariaDB instance
running in a Docker container.

The testing process involved the following steps:

1. A local testdb database with a products table was created in the
MariaDB container.
2. For Gemini CLI integration, the ~/.gemini/settings.json file was
configured to point to a local build of the toolbox executable.
3. The toolbox was launched in UI mode using the **_./toolbox
--prebuilt=mysql --ui_** command.
4. Two connection scenarios were tested to validate the new logic.

**Test 1: Default Connection (Host/Port Unset)**

The MYSQL_HOST and MYSQL_PORT environment variables were unset. The
application correctly defaulted to localhost:3306 and successfully
connected to the testdb database.
<img width="2087" height="1102" alt="Screenshot 2025-11-11 11 31 45 PM"
src="https://github.com/user-attachments/assets/a8ef5f92-eaca-472f-a0df-e2b3c0c027da"
/>

**Test 2: Explicit Connection (Host/Port Set)**

The MYSQL_HOST and MYSQL_PORT environment variables were explicitly set.
The application correctly used these values, overriding the defaults and
establishing a successful connection.
<img width="2073" height="958" alt="Screenshot 2025-11-11 6 12 44 PM"
src="https://github.com/user-attachments/assets/4b9b8838-091f-4c78-9e3b-97768323693c"
/>

**Result:**

In both scenarios, the list_tables prebuilt tool was executed via the
Toolbox UI, which successfully returned the products table from the
testdb database, confirming the changes work as expected.

Screenshot of list_tables execution from the Toolbox UI:
<img width="2251" height="1240" alt="result"
src="https://github.com/user-attachments/assets/f1c5372d-acc0-4551-af2d-fa1ee4b228d7"
/>

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes [#29](https://github.com/gemini-cli-extensions/mysql/issues/29)

---------

Co-authored-by: prernakakkar-google <158031829+prernakakkar-google@users.noreply.github.com>
2025-11-12 21:22:06 +00:00
Valipishetty Sathwik
7e6e88a21f feat(tool/Postgresql): Set default host and port for Postgresql source (#1927)
### Description

This pull request addresses issue #41 by implementing default connection
values for the Postgresql data source. When a user does not specify a
host or port, the connection will now automatically default to
`localhost:5432`.

---

### Detailed Changes

- **docs/en/reference/prebuilt-tools.md**
   -updated the env variables host and port to optional in the doc

- **internal/prebuiltconfigs/tools/postgres.yaml**
- Added the default values to host and port. Specifically, they are now
`host: ${POSTGRES_HOST:localhost}` and `port: ${POSTGRES_PORT:5432}`.
This allows the configuration loader to directly use `"localhost"` or
`"5432"` as a fallback if the `POSTGRES_HOST` or `POSTGRES_PORT`
environment variables are not set.

---

### PR Checklist

Thank you for opening a Pull Request! Before submitting your PR, there
are a few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed  
  CONTRIBUTING.md
- [ ] Make sure to open an issue as a  
  bug/issue  
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add ! if this involve a breaking change



🛠️ **Fixes** #41

---------

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-11-12 19:08:06 +00:00
Twisha Bansal
cd56ea44fb feat: Added prompt support for toolbox (#1798)
## Description

Added MCP prompt support in the toolbox server.

- No updates needed corresponding to
https://github.com/googleapis/genai-toolbox/pull/1828/files.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed
[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes https://github.com/googleapis/genai-toolbox/issues/1040

---------

Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
Co-authored-by: dishaprakash <57954147+dishaprakash@users.noreply.github.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Averi Kitsch <akitsch@google.com>
Co-authored-by: Anmol Shukla <shuklaanmol@google.com>
Co-authored-by: Harsh Jha <83023263+rapid-killer-9@users.noreply.github.com>
Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
Co-authored-by: Dr. Strangelove <drstrangelove@google.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Dave Borowitz <dborowitz@google.com>
2025-11-11 23:07:51 +05:30
Sri Varshitha
12bdd95459 feat(source/alloydb, source/cloud-sql-postgres,source/cloud-sql-mysql,source/cloud-sql-mssql): Use project from env for alloydb and cloud sql control plane tools (#1588)
## Description

---
This change introduces the `DefaultProject` field for the
`alloydb-admin` and `cloud-sql-admin` sources. This field allows the
alloydb and cloud sql control plane tools to use the project value from
the environment variables (Ex: `ALLOYDB_POSTGRES_PROJECT`) if it is
already set instead of asking the user.

## PR Checklist

---
> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes: https://github.com/gemini-cli-extensions/alloydb/issues/47

---------

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-11-11 04:14:47 +00:00
Yuan Teoh
1f833fb1a1 feat(healthcare): add support for healthcare source, tool and prebuilt config (#1853)
## Description

Add support for healthcare source, tool and prebuilt config. This branch
consist of all previously approved PRs.

🛠️ Fixes #1648

---------

Co-authored-by: Marwan Tammam <15021613+Quarz0@users.noreply.github.com>
2025-11-06 17:06:04 -08:00
Yuan Teoh
559e2a22e0 fix: bigquery result column order (#1884)
Assigning job iterator value to an array instead of map to preserve
column order.

When assigning incoming values to map, sometimes the result is not in
order of statement. E.g. `SELECT id, name from ...` might turn into
`{"name": "name_value", "id":1}` rather than `{"id":1, "name":
"name_value"}`. Previously, during json marshaling, it will ALWAYS order
the map in alphabetical order. so that wasn't an issue.

With the implementation of `orderedmap` (#1852), the bigquery execute
sql tool will now preserves the column order during the marshaling
process. Due to this, bigquery's integration test is flaky and failed
when the map is reordered. This update assign incoming value as array
instead, preserving the actual order.
2025-11-06 22:02:25 +00:00
Dr. Strangelove
30857c2294 feat(tools/looker-run-dashboard): new run_dashboard tool (#1858)
## Description

The run_dashboard tool will run the query associated with each tile of
the dashboard and return the full set of query results. It enables the
agent to answer questions like "Summarize this dashboard for me".

---------

Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2025-11-06 16:45:31 -05:00
Dr. Strangelove
27663f0a12 chore(singlestore): fix lint issues (#1890) 2025-11-06 20:15:12 +00:00
Dr. Strangelove
991e539f9c feat(tools/looker-run-look): modify run_look to show query origin (#1860)
… as coming from MCP Toolbox
2025-11-06 19:48:41 +00:00
Pavlo Mishchenko
40b9dbab08 feat(singlestore): Add SingleStore Source and Tools (#1333)
## Description
---
- This PR adds SingleStore database source and tools. The code is mostly
based on MySQL source and tools, and it uses the same go-mysql driver.
- https://github.com/singlestore-labs/singlestoredb-dev-image can be
used to deploy a test SingleStore instance. In this PR the default port
is set to 3308 so the command would be
```docker run \
    -d --name singlestoredb-dev \
    -e ROOT_PASSWORD="YOUR SINGLESTORE ROOT PASSWORD" \
    -p 3308:3306 ghcr.io/singlestore-labs/singlestoredb-dev:latest
```
## PR Checklist
---
> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:
- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/langchain-google-alloydb-pg-python/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes https://github.com/googleapis/genai-toolbox/issues/1348

---------

Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
2025-11-06 12:19:38 -05:00
Srividya Reddy
1a19cac7cd feat(tools/postgres-list-schemas): add new postgres-list-schemas tool (#1741)
## Description
Add a read-only PostgreSQL custom list_schemas tool, that returns the
schemas present in the database excluding system and temporary schemas.
Returns the schema name, schema owner, grants, number of functions,
number of tables, and number of views within each schema.

<img width="1985" height="1043" alt="Screenshot 2025-10-20 at 7 45
45 PM"
src="https://github.com/user-attachments/assets/8c4f0bb8-587c-489a-8795-efa79e92b06f"
/>

<img width="3372" height="1694" alt="3NpZG7W6h3XGsM7"
src="https://github.com/user-attachments/assets/370b5440-cc48-4c4e-82ea-4fd508cbcf2b"
/>

> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2025-11-06 00:54:01 +00:00
Laurent Saint-Félix
5367285e91 feat(sources/elasticsearch): add Elasticsearch source and tools (#1109)
Add support for Elasticsearch with the following tools:
* search
* esql
* get_mappings
* list_indices

This PR fixes #859

---------

Co-authored-by: duwenxin <duwenxin@google.com>
Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
2025-11-05 19:33:37 -05:00
Yuan Teoh
d7f68ebb1a test: update bigquery and mindsdb integration tests (#1866)
Update bigquery test to include column order for SELECT statement.
Update mindsdb tests to drop table before creating. The whole
integration test pause when there's a failure from any one of
integration tests. If the test pause after `CREATE` and before `DROP`,
the int test will fail when running it again.
2025-11-05 16:12:21 -08:00
Wenxin Du
b24d2a5a49 chore: update file names and docs (#1867)
1. Rename `mindsdb/mysql.go` to `mindsdb/mindsdb.go`
2. Capitalize `Couchbase` on the doc title
3. Rephrase some MindsDB docs
2025-11-05 17:34:34 -05:00
Dave Borowitz
2881683226 feat(serverless-spark): add cancel-batch tool 2025-11-05 11:13:35 -08:00
Bala Narasimhan
c5962bd96f chore: introduce orderedmap to preserve column order in SQL results during marshal (#1852)
This commit introduces a new `orderedmap` package to preserve the column
order of SQL query results when they are marshaled to JSON.

The default Go `json.Marshal` function sorts map keys, which was causing
the column order to be lost in the output of the database tools.

This commit updates the following tools to use the new `orderedmap`
package:
- `mysqlexecutesql`
- `mssqlexecutesql`
- `postgresexecutesql`
- `spannerexecutesql`
- `sqliteexecutesql`
- `bigqueryexecutesql`

A new test has been added to the `mysqlexecutesql` tool to verify that
the column order is preserved.

## Description

> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1492

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Yuan Teoh <yuanteoh@google.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2025-11-05 18:43:33 +00:00
Dr. Strangelove
50c400063b chore: fix linter issues (#1859) 2025-11-05 09:27:31 -08:00
Twisha Bansal
954152c792 fix(cloudmonitoring): populate authRequired in tool manifest (#1800)
## Description

Corrects an issue where the `cloud-monitoring-query-prometheus` tool
would fail to populate the `authRequired` field in its generated
manifest.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>
2025-11-05 08:14:55 +00:00
Jorge Torres
1b2cca9faa feat: Add MindsDB Source and Tools (#878)
🚀 Add MindsDB Integration: Expand Toolbox to Hundreds of Datasources
Overview
This PR introduces comprehensive MindsDB integration to the Google GenAI
Toolbox, enabling SQL queries across hundreds of datasources through a
unified interface. MindsDB is the most widely adopted AI federated
database that automatically translates MySQL queries into REST APIs,
GraphQL, and native protocols.
🎯 Key Value for Google GenAI Toolbox Ecosystem
1. Massive Datasource Expansion
Before: Toolbox limited to ~15 traditional databases
After: Access to hundreds of datasources including Salesforce, Jira,
GitHub, MongoDB, Gmail, Slack, and more
Impact: Dramatically expands the toolbox's reach and utility for
enterprise users
2. Cross-Datasource Analytics
New Capability: Perform joins and analytics across different datasources
seamlessly
Example: Join Salesforce opportunities with GitHub activity to correlate
sales with development activity
Value: Enables comprehensive data analysis that was previously
impossible
3. API Abstraction Layer
Innovation: Write standard SQL queries that automatically translate to
any API
Benefit: Developers can query REST APIs, GraphQL, and native protocols
using familiar SQL syntax
Impact: Reduces complexity and learning curve for accessing diverse
datasources
4. ML Model Integration
Enhanced Capability: Use ML models as virtual tables for real-time
predictions
Example: Query customer churn predictions directly through SQL
Value: Brings AI/ML capabilities into the standard SQL workflow
🔧 Technical Implementation
Source Layer
 New MindsDB source implementation using MySQL wire protocol
 Comprehensive test coverage with integration tests
 Updated existing MySQL tools to support MindsDB sources
 Created dedicated MindsDB tools for enhanced functionality
Tools Layer
 mindsdb-execute-sql: Direct SQL execution across federated datasources
 mindsdb-sql: Parameterized SQL queries with template support
 Backward compatibility with existing MySQL tools
Documentation & Configuration
 Comprehensive documentation with real-world examples
 Prebuilt configuration for easy setup
 Updated CLI help text and command-line options
📊 Supported Datasources
Business Applications
Salesforce (leads, opportunities, accounts)
Jira (issues, projects, workflows)
GitHub (repositories, commits, PRs)
Slack (channels, messages, teams)
HubSpot (contacts, companies, deals)
Databases & Storage
MongoDB (NoSQL collections as structured tables)
Redis (key-value stores)
Elasticsearch (search and analytics)
S3, filesystems, etc (file storage)
Communication & Email
Gmail/Outlook (emails, attachments)
Microsoft Teams (communications, files)
Discord (server data, messages)
🎯 Example Use Cases
Cross-Datasource Analytics
-- Join Salesforce opportunities with GitHub activity
```
SELECT 
    s.opportunity_name,
    s.amount,
    g.repository_name,
    COUNT(g.commits) as commit_count
FROM salesforce.opportunities s
JOIN github.repositories g ON s.account_id = g.owner_id
WHERE s.stage = 'Closed Won';
```

Email & Communication Analysis
```
-- Analyze email patterns with Slack activity
SELECT 
    e.sender,
    e.subject,
    s.channel_name,
    COUNT(s.messages) as message_count
FROM gmail.emails e
JOIN slack.messages s ON e.sender = s.user_name
WHERE e.date >= '2024-01-01';
```





🚀 Benefits for Google GenAI Toolbox
Enterprise Adoption: Enables access to enterprise datasources
(Salesforce, Jira, etc.)
Developer Productivity: Familiar SQL interface for any datasource
AI/ML Integration: Seamless integration of ML models into SQL workflows
Scalability: Single interface for hundreds of datasources
Competitive Advantage: Unique federated database capabilities in the
toolbox ecosystem
📈 Impact Metrics
Datasource Coverage: +1000% increase in supported datasources
API Abstraction: Eliminates need to learn individual API syntaxes
Cross-Platform Analytics: Enables previously impossible data
correlations
ML Integration: Brings AI capabilities into standard SQL workflows
🔗 Resources
MindsDB Documentation
MindsDB GitHub
Updated Toolbox Documentation
 Testing
 Unit tests for MindsDB source implementation
 Integration tests with real datasource examples
 Backward compatibility with existing MySQL tools
 Documentation examples tested and verified
This integration transforms the Google GenAI Toolbox from a traditional
database tool into a comprehensive federated data platform, enabling
users to query and analyze data across their entire technology stack
through a unified SQL interface.

---------

Co-authored-by: duwenxin <duwenxin@google.com>
Co-authored-by: setohe0909 <setohe.09@gmail.com>
Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2025-11-05 01:09:30 +00:00
Thomas Bottrill
9723cadaa1 fix(tools/alloydbainl)!: AlloyDB AI NL execute_sql statement order (#1753)
## Description

The order of parameters in alloydb_ai_nl.execute_nl_query changed, which
broke the alloydbainl tool. This adds named parameters to the statement
in the tool, which fixes this.

This will be a breaking change for existing user that defined their
natural language configuration with the `create_configure` operation.
The `execute_nl_query` input argument parameter and order had been
updated recently, hence, users that are defining their configuration
with the latest instructions will not be able to use Toolbox. This
update is inevitable.

Previously, user will create the configuration with the following:
```
CALL google_ml.create_model(model_id => 'gemini-2_0_flash', ...);
SELECT alloydb_ai_nl.g_manage_configuration(
  'create_configuration', -- operation
  'my_nl_config', -- configuration_id_in
  'gemini-2_0_flash' -- model_id_in
);

SELECT alloydb_ai_nl.g_manage_configuration(
   operation => 'register_table_view',
   configuration_id_in => 'my_nl_config',
   table_views_in=>'{auth_psv}');
```

Currently, user will create the configuration with the following:
```
SELECT alloydb_ai_nl.g_create_configuration(configuration_id =>'my_nl_config');

SELECT alloydb_ai_nl.g_manage_configuration(
   operation => 'register_table_view',
   configuration_id_in => 'my_nl_config',
   table_views_in=>'{auth_psv}'
);
```

This PR also updates the nl_question from "return 1" to "return the
number 1" to provide more context to the model.

A new `ainl_update_testing` database was created with the new NL
configuration in order to not break existing integration tests before
merging this PR. Once this is merged, the existing `test_database`
database will be updated and will update the integration test's database
again.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [X] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [X] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [X] Ensure the tests and linter pass
- [X] Code coverage does not decrease (if any source code was changed)
- [X] Appropriate docs were updated (if necessary)
- [X] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1752

---------

Co-authored-by: Yuan Teoh <yuanteoh@google.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2025-11-05 00:37:39 +00:00
Wenxin Du
cf7012a82b feat(source/bigquery): add client cache for user-passed credentials (#1119)
Add client cache and automatic cache cleanup. 
The cache is managed by a map with OAuth access token as the keys.
Upon user tool invocation, get client from existing cache or create a
new one.
2025-11-04 17:16:44 -05:00
Averi Kitsch
3cff915e22 fix: debug logging statements (#1828)
## Description

The debug context logger does not take in value placeholders. The
statements must be first converted to a string.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>
2025-11-03 19:24:11 +00:00
Dr. Strangelove
d7d1b03f3b feat(tools/looker): tools to retrieve the connections, schemas, databases, and column metadata from a looker system. (#1804)
## Description

Add new tools to get metadata from databases through Looker

* get_connections
* get_connection_schemas
* get_connection_databases
* get_connection_tables
* get_connection_table_columns
2025-10-31 18:42:02 +00:00
Averi Kitsch
898428759c fix(tools/postgres-execute-sql): do not ignore SQL failure (#1829)
## Description

Invalid SQL like selecting from invalid tables or granting bad
permissions resulted in a null due to the missing error statement.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1638
2025-10-31 17:39:35 +00:00
Colin Pistell
e09d182f88 feat(source/bigquery): add service account impersonation support for bigquery (#1641)
## Description

This change adds service account impersonation support to Bigquery.
Users can now optionally supply an `impersonateServiceAccount` field in
their `bigquery-source` config to enable impersonation.

---
> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

## PR Checklist

---
> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #906
2025-10-31 16:43:52 +00:00
Yuan Teoh
38d535de34 fix(source/cloud-sql-mssql): remove ip address field (#1822)
## Description

Removing the `ipAddress` field since it is not an input for Cloud SQL
SQL Server source.

Kept the variable in Source's config but removed this variable from
everywhere else in the code. This will PREVENT a breaking change since
the validator won't flag it as an "extra field".

**Will have to update the following as well:**
(1) Cloud docs
https://cloud.google.com/sql/docs/sqlserver/pre-built-tools-with-mcp-toolbox
(2) gemini-cli-extensions
https://github.com/gemini-cli-extensions/cloud-sql-sqlserver

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1549
2025-10-30 17:14:19 -07:00
Huan Chen
ef28e39e90 feat(tools/bigquery-analyze-contribution): add allowed dataset support (#1675)
## Description

> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

---------

Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2025-10-30 21:44:30 +00:00
Huan Chen
a2006ad577 feat(tools/bigquery-get-dataset-info)!: add allowed dataset support (#1654)
## Description

---
This introduces a breaking change. The bigquery-get-dataset-info tool
will now enforce the allowed datasets setting from its BigQuery source
configuration. Previously, this setting had no effect on the tool.

## PR Checklist

---
> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Part of https://github.com/googleapis/genai-toolbox/issues/873
2025-10-30 13:45:02 -07:00
Dr. Strangelove
fae133930f fix(tools/looker): better description and docs for Looker health (#1814)
## Description

Improve the docs for the Looker health tools
2025-10-30 11:20:39 -07:00
Philippe Batardiere
a8e98dc99d feat: Added ExcludeValues + Fixed issue with regex matching type. (#1818)
## Description

### This PR introduces a new excludedValues field for tool parameters,
enhancing validation capabilities.

This change introduces a new excludedValues field for tool parameters.
This field allows developers to specify a list of values that are not
allowed for a parameter.
The excludedValues field supports both exact value matching and regular
expression matching.

The changes include:
- Updating the tool parameter documentation to include the
excludedValues field.
- Adding the excludedValues field to the CommonParameter struct.
- Implementing the logic to check for excluded values in the Parse
method of each parameter type.
- Updating the MatchStringOrRegex function to support non-string inputs
by converting them to strings before regex matching. This makes the
allowedValues and excludedValues checks more robust.
- Adding unit tests for allowedValues to verify the MatchStringOrRegex
change on parameters.
- Adding unit tests to verify the excludedValues functionality.

## PR Checklist

- [x] Make sure you reviewed
CONTRIBUTING.md
(httpshttps://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a
bug/issue
(https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [ ] Make sure to add ! if this involve a breaking change

🛠️ Fixes #1792

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-10-29 16:32:57 -07:00
Wenxin Du
208ab92eb3 feat: Make MongoDB filterParams optional (#1614)
Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-10-29 21:29:12 +00:00
Srividya Reddy
e8c7fe0994 feat(tools/postgres-list-views): add new postgres-list-views tool (#1709)
## Description

Adds a read-only PostgreSQL custom list_views tool, that returns the
details of views present in database. Each row includes: schema_name,
view_name, owner_name
Test Output:

<img width="2433" height="1274" alt="Screenshot 2025-10-19 at 3 59
31 PM"
src="https://github.com/user-attachments/assets/76e1e994-390a-4239-aba7-0d02253bbcc4"
/>
<img width="2533" height="1017" alt="Screenshot 2025-10-19 at 4 07
25 PM"
src="https://github.com/user-attachments/assets/537fbddd-d862-4044-a09b-cb9f180c21fa"
/>

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1738

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-10-29 14:18:29 -07:00
Dave Borowitz
7ad10720b4 feat(serverless-spark): Add get_batch tool 2025-10-28 13:42:02 -07:00
Dr. Strangelove
4b0172083c fix: instructions to quote filters that include commas (#1794)
## Description

A filter value like `{"user.city": "New York, NY"}` gets interpretted by
Looker as a list of values, and so becomes SQL like
`IN ('New York', 'NY')`. Need to pass a filter value like `{"user.city":
"'New York, NY'"}`.

Add instructions to agents to properly quote filter values that contain
commas.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [X] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [X] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [X] Ensure the tests and linter pass
- [X] Code coverage does not decrease (if any source code was changed)
- [X] Appropriate docs were updated (if necessary)
- [X] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1790
2025-10-27 17:49:05 +00:00
Dave Borowitz
816dbce268 feat(serverless-spark): Add serverless-spark source with list_batches tool
Built as a thin wrapper over the official Google Cloud Dataproc Go
client library, with support for filtering and pagination.
2025-10-23 20:40:52 -07:00
nester-neo4j
f475da63ce feat(neo4j): Add dry_run parameter to validate Cypher queries (#1769)
This pull request adds support for a new `dry_run` mode to the Neo4j
Cypher execution tool, allowing users to validate queries and view
execution plans without running them. It also sets a custom user agent
for Neo4j connections and improves error handling and documentation. The
most important changes are grouped below.

### New dry run feature for Cypher execution

* Added an optional `dry_run` boolean parameter to the
`neo4j-execute-cypher` tool, allowing users to validate Cypher queries
and receive execution plan details without running the query. The tool
now prepends `EXPLAIN` to the query when `dry_run` is true and returns a
structured summary of the execution plan.
[[1]](diffhunk://#diff-de7fdd7e68c95ea9813c704a89fffb8fd6de34e81b43a484623fdff7683e18f3L87-R93)
[[2]](diffhunk://#diff-de7fdd7e68c95ea9813c704a89fffb8fd6de34e81b43a484623fdff7683e18f3R155-R188)
[[3]](diffhunk://#diff-de7fdd7e68c95ea9813c704a89fffb8fd6de34e81b43a484623fdff7683e18f3R219-R236)
[[4]](diffhunk://#diff-1dca93fc9450e9b9ea64bc1ae02774c3198ea6f8310b2437815bd1a5eae11e79L30-R32)
* Updated integration tests to cover the new `dry_run` functionality,
including successful dry runs, error handling for invalid syntax, and
enforcement of read-only mode.
[[1]](diffhunk://#diff-b07de4a304bc72964b5de9481cbc6aec6cf9bb9dabd903a837eb8974e7100a90R163-R169)
[[2]](diffhunk://#diff-b07de4a304bc72964b5de9481cbc6aec6cf9bb9dabd903a837eb8974e7100a90R250-R291)

### Improved error handling

* Enhanced error messages for parameter casting in the tool's `Invoke`
method to clarify issues with input parameters.

### Neo4j driver configuration

* Set a custom user agent (`genai-toolbox/neo4j-source`) for Neo4j
driver connections to help identify requests from this tool.
[[1]](diffhunk://#diff-3f0444add0913f1722d678118ffedc70039cca3603f31c9927c06be5e00ffb29R24-R29)
[[2]](diffhunk://#diff-3f0444add0913f1722d678118ffedc70039cca3603f31c9927c06be5e00ffb29L109-R113)

### Documentation updates

* Updated the documentation to describe the new `dry_run` parameter and
its usage for query validation.

---------

Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2025-10-23 15:22:13 -07:00
Ajaykumar Yadav
7a88161f02 feat(server): Expand init logs to list names of sources,toolsets,tools,authservices (#1117)
Description
Expanded init/startup logs
<img width="2248" height="291" alt="image"
src="https://github.com/user-attachments/assets/026d0382-a752-4b8f-b5fd-ba59a8d9e8cf"
/>

Related issue(s)
fixed: https://github.com/googleapis/genai-toolbox/issues/1089

Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
2025-10-23 17:01:11 -04:00
Wenxin Du
bd16ba3921 fix(tools/http): omit optional nil query parameters (#1762)
🛠️ Fixes https://github.com/googleapis/genai-toolbox/issues/1737
2025-10-23 02:56:12 +00:00
Yuan Teoh
eaf77406fd feat: support allowedValues, escape, minValue and maxValue for parameters (#1770)
## Description

To minimize SQL injection risks when using template parameters, it is
highly recommended that user utilizes the following added fields for
parameters.

### Allow user to indicate allowed values via list or regex
Add new `allowedValues` field to all parameter type. It can be used as
follows (can be used in the `parameter` field or `templateParameter`
field):

```
templateParameters:
    - name: tableName
       type: string
       description: table name.
       allowedValues:
            - flights_table
            - tickets_table
            - "^h.*" # support any words starting with the letter h
```

### Support escaping delimiters for identifiers in string parameters
Supporting `backticks`, `double-quotes`, `single-quotes`,
`square-brackets` as escaping delimiters. Example to apply escaping
delimiters:
```
# other fields
statement: SELECT {{array .columnName}} FROM {{ .tableName }}
templateParameters:
      - name: tableName
        type: string
        description: table name.
        escape: double-quotes
      - name: columnName
        type: array
        description: column names.
        items:
          name: column
          type: string
          description: Name of the column to select
          escape: double-quotes
```
This example will resolve to following: - 
* Data provided: `{"tableName": "table_name", "columnName": ["foo",
"bar"]}`
* Statement with escape: `SELECT "foo", "bar" FROM "table_name"`
* Statement without escape: `SELECT foo, bar FROM table_name`

Escaping delimiters can be used for identifiers (in template parameters)
or string literals. If `allowedValues` were used, Toolbox will check for
allowed values before applying delimiters.

### Support value range in numeric parameters
Supporting `minValue` and `maxValue` for parameters of type `integer`
and `float`. Example:
```
parameters:
      - name: price
        type: integer
        description: price of item
        minValue: 1
        maxValue: 50
```

If `allowedValues` were used, Toolbox will check for allowed values
before checking for min and max values.

### References


| parameter name | type | required | description |
|------------------|-----|---------|-------------|
| allowedValues | []string | true | We will check input value against
this. User can either provide a list of allowed values or regex string.
|
| escape | string | false | Only available for type `string`. Indicate
the escaping delimiters used for the parameter. This field is intended
to be used with templateParameters. Must be one of "single-quotes",
"double-quotes", "backticks", "square-brackets". |
| minValue | int or float | false | Only available for type `integer`
and `float`. Indicate the minimum value allowed. |
| maxValue | int or float | false | Only available for type `integer`
and `float`. Indicate the maximum value allowed. |

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [x] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [x] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #779
2025-10-22 22:36:53 -04:00
Wenxin Du
a06d0d8735 fix(tools/http): allow 2xx status code on tool invocation (#1761)
🛠️ Fixes https://github.com/googleapis/genai-toolbox/issues/1759
2025-10-22 20:15:59 +00:00