458 Commits

Author SHA1 Message Date
Dr. Strangelove
565460c4ea fix: set default annotations for tools in code if annotation not provided in yaml (#2049)
## Description

This sets the default annotation (readOnlyHint, destructiveHint, etc.)
in the looker tool code.

If desired, a custom tool can override the annotation in yaml like

```yaml
tool_name:
    kind: tool-kind
    source: tool-source
    annotations:
        readOnlyHint: false
        destructiveHint: true
    description: |
        Tool Description
```

## 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

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-12-01 14:17:11 -08:00
Niraj Nandre
a03984cc15 fix(tools/alloydb-postgres-list-tables): Exclude google_ml schema from list_tables (#2046)
## Description

This Pull Request addresses an issue where the `postgres-list-tables`
tool was including the `google_ml` schema in the results when listing
tables from an AlloyDB PostgreSQL instance.

The primary change involves updating the SQL query within 

[https://github.com/googleapis/genai-toolbox/blob/main/internal/tools/postgres/postgreslisttables/postgreslisttables.go](url)
to explicitly exclude the `google_ml` schema, alongside other system
schemas.

The `WHERE` clause in the `listTablesStatement` has been modified from:

```sql
-- Original WHERE clause snippet
AND ns.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')
AND ns.nspname NOT LIKE 'pg_temp_%' AND ns.nspname NOT LIKE 'pg_toast_temp_%'
```

To:
```sql
-- Updated WHERE clause snippet
AND ns.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast','google_ml')
AND ns.nspname NOT LIKE 'pg_temp_%' AND ns.nspname NOT LIKE 'pg_toast_temp_%'
```
This ensures that tables residing in the google_ml schema are no longer
returned by the tool, improving the clarity and relevance of the table
listings for users.

## Testing

The changes were validated end-to-end by:

*   Building a custom `toolbox` binary from the modified source.
* Configuring `~/.gemini/settings.json` to use this binary as an
`alloydb-test` MCP server.
* Launching `gemini` CLI and confirming the `alloydb-test` server was `🟢
Ready` via `/mcp`.
*   Invoking the `postgres-list-tables` tool with `list tables`.
* Verifying that `google_ml` schema tables were successfully excluded
from the results.

Testing screenshot : 

<img width="2809" height="1779" alt="Screenshot 2025-11-25 3 47 43 PM"
src="https://github.com/user-attachments/assets/126cf5be-30d7-4ec1-9d31-652b5219c0ce"
/>

## 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
- [ ] 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 #2009

Co-authored-by: prernakakkar-google <158031829+prernakakkar-google@users.noreply.github.com>
2025-12-01 21:51:06 +00:00
nandinisaini-google
5e43630907 feat(prebuilt/cloud-sql): Add clone instance tool for cloud sql (#1845)
## Description

---
This pull request adds a new tool, cloud-sql-clone-instance, which
enables cloning a Cloud SQL instance from the toolbox using the Cloud
SQL Admin API. The tool supports both standard cloning and point-in-time
recovery (PITR). It also supports specifying preferred zones for cloned
instances via the preferredZone and preferredSecondaryZone fields.

Key Features:
Instance Cloning: The tool allows you to clone a Cloud SQL instance by
specifying the source and destination instance names.
Point-in-Time Recovery (PITR): By providing a pointInTime timestamp, you
can create a clone of an instance as it existed at a specific moment.
High Availability Configuration: The preferredZone and
preferredSecondaryZone parameters allow you to configure the cloned
instance for high availability.

Tested: 
<img width="1182" height="446" alt="Screenshot 2025-11-11 at 12 21
47 PM"
src="https://github.com/user-attachments/assets/7f39a5a3-3967-43d0-8041-f1d47b4fbcd9"
/>


## 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)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1915

Co-authored-by: prernakakkar-google <158031829+prernakakkar-google@users.noreply.github.com>
Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-12-01 21:31:58 +00:00
ishatilwani1301
7a9cc63376 feat(tool/mssql): Set default host and port for MSSQL source (#1943)
## Description

This pull request resolves issue
[#36](https://github.com/gemini-cli-extensions/sql-server/issues/36) by
introducing default connection parameters for the MSSQL prebuilt tool.
If a user does not specify a host or port, the tool will now default to
localhost:1433

**Changes Implemented**
The modification is in internal/prebuiltconfigs/tools/mssql.yaml, where
the host and port fields now include default values:
host: ${MSSQL_HOST:localhost}
port: ${MSSQL_PORT:1433}
This configuration allows the tool to function using the defaults, but
users can still set the MSSQL_HOST or MSSQL_PORT environment variables
to override them.

**Validation Process**
Validated changes by running the toolbox against a Microsoft SQL Server
instance hosted in a Docker container.

- **Database Setup:** A testdb database containing a products table was
initialized.
- **CLI Configuration:** The ~/.gemini/settings.json file was updated to
point to my local toolbox build.
- **Tool Launch:** The UI was started using go run . --prebuilt mssql
--ui
- **Testing:** Confirmed the connection logic by testing two scenarios.
One with the environment variables set and one without (to confirm the
default logic).

**1.** Default Value Connection: For this test, the MSSQL_HOST and
MSSQL_PORT environment variables were not defined. The application
correctly utilized the new default values (localhost:1433) to connect to
the testdb.
<img width="2175" height="1144" alt="Screenshot 2025-11-12 6 33 05 PM"
src="https://github.com/user-attachments/assets/bacfc9bf-8b35-42e1-ad53-4af3aef27125"
/>

**2.** Explicit Variable Connection: For the second test, MSSQL_HOST and
MSSQL_PORT were set to specific values. The application correctly
prioritized these variables over the new defaults and connected
successfully.
<img width="2175" height="1144" alt="Screenshot 2025-11-12 6 37 02 PM"
src="https://github.com/user-attachments/assets/61254849-211d-41f4-8c7d-ff92cf64a51c"
/>

Result: Both connection methods were verified by executing the
list_tables prebuilt tool via the UI. In each scenario, the tool
successfully retrieved the UserDetails table, confirming the changes.
<img width="2250" height="1144" alt="Screenshot 2025-11-12 6 38 12 PM"
src="https://github.com/user-attachments/assets/87085777-897e-4a74-9e3f-f36cc8a33305"
/>

## 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
[#36](https://github.com/gemini-cli-extensions/sql-server/issues/36)
2025-12-01 09:26:33 +00:00
Yuan Teoh
f59a06bd10 chore: add new argument to invoke() and RequiresClientAuthorization() (#2000)
## Description

Tool `invoke()` and `RequiresClientAuthorization()` takes a new input
argument -- Resource Manager. Resource manager will be used to retrieve
Source in the next step.

In order to achieve the goal, this PR implements the follows:
* move resource manager from the server package to a new package to
prevent import cycles (between server and mcp)
* added a new interface in `tools.go` to prevent import cycle (between
resources and tools package)
* add new input argument in all tools

## 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
2025-11-29 02:46:15 -08:00
Yuan Teoh
fb7aae9d35 fix: add import for firebirdsql (#2045)
## Description

Add the import statement for firebirdsql. Our integration test runs on
linux and did not catch this error.
Seems like windows will look for the import statement -- `unable to
create pool: unable to create connection pool: sql: unknown driver
\"firebirdsql\" (forgotten import?)"`

## 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 #2014
2025-11-27 17:58:27 +00:00
Yuan Teoh
d8ce3c7224 chore: update toolset and promptset initialize failure log (#2039)
## Description

Update error log to more details when initialization fails.
* When a toolset name is not valid, show the toolset name (similar with
promptset).
* When tool does not exist, show the tool name that is missing (similar
with prompt).

## 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 #1579
2025-11-27 17:41:16 +00:00
Yuan Teoh
862868f284 feat: add allowed-origins flag (#1984)
Support `allowed-origins` flag to allow secure deployment of Toolbox.
Current Toolbox is **insecure by default**, which allows all origin
(`*`). This PR also updated docs to notify user of the new
`allowed-origins` flag in the Cloud Run, kubernetes, and docker
deployment docs.

This PR was tested manually by mocking a browser access:
1. Created a HTML file with Javascript fetch named
`malicious-client.html`:
```
<!DOCTYPE html>
<html>
<head>
    <title>Malicious CORS Test</title>
</head>
<body>
    <h1>Attempting to access API at http://127.0.0.1:5000/mcp</h1>
    <p>Check the **Chrome Developer Console** (F12 -> Console tab) for the result.</p>

    <script>
        fetch('http://127.0.0.1:5000/mcp', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                // The browser automatically adds the 'Origin' header based on where this HTML is served from (http://localhost:8000)
            },
            body: JSON.stringify({
                "jsonrpc": "2.0",
                "id": 1,
                "method": "tools/list"
            })
        })
        .then(response => {
            console.log('Success (but check console for CORS enforcement details):', response);
            return response.json();
        })
        .then(data => console.log('Data received (only if CORS passes):', data))
        .catch(error => console.error('Fetch Error:', error));
    </script>

</body>
</html>
```
2. Run `python3 -m http.server 8000`
3. Open `http://localhost:8000/malicious-client.html` in browser.
4. Tried without `--allowed-origins` flag -- success.
     Tried with `--allowed-origins=http://localhost:8000` -- success.
     Tried with `--allowed-origins=http://foo.com` -- unsuccessful.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-11-27 17:03:53 +00:00
Siddharth Ravi
9f76026925 feat: add list-query-stats and get-column-cardinality functions (#1976)
Adds the following tools for Postgre
(1) get_column_cardinality - to fetch the estimates of the distinct
column counts in the table for particular column or all columns
(2) list-query-stats - to obtain the query level statistics in a
database. This tool requires pg_stat_statements extension as a
prerequisite.

<img width="2428" height="1368" alt="image"
src="https://github.com/user-attachments/assets/5d9b22f0-6b09-4abe-8411-b1139387e259"
/>

<img width="3774" height="1010" alt="image"
src="https://github.com/user-attachments/assets/b1d9fdf1-8a3b-4afe-ab98-63226a7e3705"
/>


PR Checklist
[Y] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
[Y] 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
[Y] Ensure the tests and linter pass
[Y] Code coverage does not decrease (if any source code was changed)
[Y] Appropriate docs were updated (if necessary)
[Y] Make sure to add ! if this involve a breaking change

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

---------

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-11-26 23:43:03 +00:00
Dr. Strangelove
ac21335f4e feat: support for annotations (#2007)
## Description

The MCP spec supports tool annotations like the below structure in the
2025-06-18 version of the spec.

https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations

```
{
  destructiveHint?: boolean;
  idempotentHint?: boolean;
  openWorldHint?: boolean;
  readOnlyHint?: boolean;
}
```

Added a ToolAnnotations structure, an Annotations member to the
McpManifest structure, and a nil initializer for the Annotations member
to all calls to GetMcpManifest.

The ToolAnnotations structure and the member annotations are all defined
as pointers so that they are omited when not set. There are times when
the zero value is meaningful so this was the only way to make sure that
we distinguish between not setting the annotation and setting it with a
zero value.

## 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 #927

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-26 08:53:55 -05:00
gRedHeadphone
a0f44d34ea feat(tools/spanner-list-graph): tool impl + docs + tests (#1923)
## Description

Spanner List Graphs tool, similar to list tables it can be used to get
all/specific graph details

## PR Checklist

- [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 #1916

---------

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-11-25 16:09:25 +00:00
Yuan Teoh
730ac6d228 fix(tools/alloydbcreateuser): remove duplication of project praram (#2028)
## Description

The project parameter was defined within an if-else statement before the
other parameters were defined.
2025-11-25 02:10:12 +00:00
aniketkumarj
8752e05ab6 feat(tools/cloudsqlpg): Add CloudSQL PostgreSQL pre-check tool (#1722)
## Description

Implements the 'postgres-upgrade-precheck' tool to allow users to
validate instance readiness for major version upgrades for CloudSQL
PostgreSQL.

This includes the tool implementation, unit tests for YAML parsing,
integration tests for tool invocation, and documentation. The tool is
also added to the CloudSQL PostgreSQL prebuilt set.

TEST output: 
<img width="3406" height="1646" alt="image"
src="https://github.com/user-attachments/assets/6abaa535-285d-4645-9dd3-7ebcd447d448"
/>
<img width="3532" height="1490" alt="image"
src="https://github.com/user-attachments/assets/4d512af1-51fd-4187-b80f-be13198aba68"
/>



## 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 #1721

---------

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-11-24 17:41:50 +00:00
Averi Kitsch
58d31a9f51 chore(deps): update module github.com/gocql/gocql to v2 (#1967)
## 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>

---------
2025-11-19 18:19:08 -08:00
Dr. Strangelove
18017d6545 feat: support alternate accessToken header name (#1968)
## Description

This commit allows a tool to pull an alternate authorization
token from the header of the http request.

This is initially being built for the Looker integration. Looker
uses its own OAuth token. When deploying MCP Toolbox to Cloud
Run, the default token in the "Authorization" header is for
authentication with Cloud Run. An alternate token can be put into
another header by a client such as ADK or any other client that
can programatically set http headers. This token will be used
to authenticate with Looker.

If needed, other sources can use this by setting the header name
in the source config, passing it into the tool config, and returning
the header name in the Tool GetAuthTokenHeaderName() function.

## 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 #1540
2025-11-19 23:00:13 +00:00
Yuan Teoh
0e269a1d12 fix(tools/alloydbgetinstance): remove parameter duplication (#1993)
## Description

Previous merge conflict caused parameter duplications

## 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/97
2025-11-19 19:43:00 +00:00
Yuan Teoh
504391b60d chore: embed Config into resource for prompts (#1951)
To keep a persistent backend storage for configuration, we will have to
keep a single source of truth. This involves supporting bi-directional
conversion for Prompt and Promptsets.


This PR make the following changes:
* Separate Prompt from PromptConfig
* Embed Config in Resources (for both prompt and promptset)
* Add `ToConfig()` to extract Config from Resources (for both prompt and
promptset)
2025-11-18 16:14:11 -08:00
Siddharth Ravi
5abad5d56c feat(tools/postgres): add long_running_transactions, list_locks and replication_stats tools (#1751)
Adds the following tools for Postgre
(1) long_running_transactions - reports transactions that exceed a
configured duration threshold.
(2) list_locks - lists active locks in the database, including the
associated process, lock type, relation, mode, and the query holding or
waiting on the lock.
(3) replication_stats - reports replication-related metrics for WAL
streaming replicas, including lag sizes presented in human-readable
form.

<img width="3020" height="1420" alt="image"
src="https://github.com/user-attachments/assets/e7d70063-b90c-4464-90ec-1bd810c02cac"
/>

<img width="3036" height="1374" alt="image"
src="https://github.com/user-attachments/assets/f7cf584b-ae01-455c-9c9c-acca3166a549"
/>

<img width="2682" height="868" alt="image"
src="https://github.com/user-attachments/assets/dd10646c-4521-4d8f-a111-760d6eb01249"
/>


## PR Checklist
- [Y] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [Y] 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
- [Y] Ensure the tests and linter pass
- [Y] Code coverage does not decrease (if any source code was changed)
- [Y] Appropriate docs were updated (if necessary)
- [Y] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #1691 #1715

---------

Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com>
2025-11-18 19:23:10 +00:00
Yuan Teoh
2bff1384a3 fix(tools): check for query execution error for pgxpool.Pool (#1969)
## Description

Return error if there's error during query execution. AlloyDB AI NL tool
was failing query silently. When this happened, the user was just
receiving `nil` response and not informed of what the error was.

## 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 #1949
2025-11-18 10:24:03 -08:00
gRedHeadphone
446d62acd9 fix(tools/spanner-list-tables): unmarshal object_details json string into map to make response have nested json (#1894)
## Description

Unmarshal object_details json string into map to make response have
nested json in spannerlisttables instead of nested JSON string

## PR Checklist

- [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 #1838

---------

Co-authored-by: Averi Kitsch <akitsch@google.com>
2025-11-14 14:18:57 -08:00
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