Commit Graph

528 Commits

Author SHA1 Message Date
duwenxin
8b73ad690c update tools.go 2026-02-09 18:37:13 -05:00
duwenxin
288cd5acc3 sbenp.prettier-vscode 2026-02-09 15:25:39 -05:00
duwenxin
3353d82f64 fix mcp test 2026-02-09 15:25:39 -05:00
duwenxin
7fc48e2693 fix cloud sql test 2026-02-09 15:25:39 -05:00
duwenxin99
e086b67791 rebase 2026-02-09 15:25:39 -05:00
duwenxin99
abe8ed4f17 moved to a separate package 2026-02-09 15:25:38 -05:00
duwenxin99
a96e1d33d5 rebase 2026-02-09 15:25:38 -05:00
duwenxin99
df20bbad9f moved to a separate package 2026-02-09 15:25:38 -05:00
duwenxin99
3c51417602 fix lint 2026-02-09 15:25:38 -05:00
duwenxin99
10d7397c01 all refactor done 2026-02-09 15:25:38 -05:00
duwenxin
803161c0b3 refactor redis 2026-02-09 15:25:38 -05:00
duwenxin
9882c11411 refactor looker 2026-02-09 15:25:38 -05:00
duwenxin
209b04e176 refactor looker 2026-02-09 15:25:38 -05:00
duwenxin
42797ca435 update more tools 2026-02-09 15:25:38 -05:00
duwenxin
7478310c57 update more looker tools 2026-02-09 15:25:37 -05:00
duwenxin
519c9067ba api error 2026-02-09 15:25:37 -05:00
duwenxin
140f9a38f7 update more tools 2026-02-09 15:25:37 -05:00
duwenxin
9c90ce0b4f add dataplex firestore 2026-02-09 15:25:37 -05:00
duwenxin
1738521ee5 add gcp tools refactor 2026-02-09 15:25:37 -05:00
duwenxin
67f2384bce refactor bigquery errors 2026-02-09 15:25:37 -05:00
duwenxin
b40d7bec1d update alloydb agent errors 2026-02-09 15:25:37 -05:00
duwenxin
352ca6c52b update mock tool interface 2026-02-09 15:25:37 -05:00
duwenxin
4dd0878378 update alloydb tools error 2026-02-09 15:25:37 -05:00
duwenxin99
73965a4b77 rebase 2026-02-09 15:25:37 -05:00
duwenxin99
637db1fbc2 moved to a separate package 2026-02-09 15:25:37 -05:00
duwenxin
e3fe531530 update agent error in parsing 2026-02-09 15:25:28 -05:00
duwenxin
e0ce2f49ff update api err parsing 2026-02-09 15:08:31 -05:00
duwenxin99
9ee0491736 rebase 2026-02-04 16:24:47 -05:00
duwenxin99
c733f03717 update unit test 2026-02-04 16:24:47 -05:00
duwenxin99
ca082d1566 resolve comments 2026-02-04 16:24:47 -05:00
duwenxin
d543381f38 resolve comments 2026-02-04 16:24:47 -05:00
duwenxin
f8ea21b428 refactor error return 2026-02-04 16:24:47 -05:00
duwenxin
15d2dafdde refactor api handler 2026-02-04 16:24:47 -05:00
duwenxin99
60b768c8ba moved to a separate package 2026-02-04 16:24:47 -05:00
duwenxin99
e73768c4db add error formatting 2026-02-04 16:23:54 -05:00
duwenxin99
1f9cd1b134 nit 2026-02-04 14:40:46 -05:00
duwenxin99
da2c103234 reset package location 2026-02-04 13:50:05 -05:00
duwenxin
0c5285c5c8 update agentError constructor 2026-02-02 18:37:45 -05:00
Wenxin Du
ac544d0878 Merge branch 'main' into err 2026-02-02 16:20:09 -05:00
duwenxin
54f9a3d312 update comment 2026-02-02 15:37:18 -05:00
duwenxin
62d96a662d add client err 2026-02-02 15:35:48 -05:00
duwenxin
46244458c4 add error code 2026-02-02 13:20:49 -05:00
Haoyu Wang
6e49ba436e feat(cli/invoke): add support for direct tool invocation from CLI (#2353)
## Description

This PR introduces a new subcommand, invoke, to the toolbox CLI. This
feature allows developers to execute tools defined in their
configuration directly from the command line.

- New Subcommand: Implemented invoke as subcommand, which handles tool
lookup, parameter unmarshaling from JSON, and invocation.
- Persistent Configuration Flags: Updated cmd/root.go to make flags like
--tools-file, --tools-folder, and --prebuilt persistent, allowing them
to be used with subcommands.
- Testing: Added unit tests for various scenarios
- Documentation: Created a new "how-to" guide for CLI tool testing and
updated the CLI reference documentation.
2026-01-29 19:46:21 -05:00
Dennis Geurts
4cff979491 chore(deps): mongodb driver version bump to v2 (#2349)
## Description

Update mongo-driver to v2, as requested by @duwenxin99  

🛠️ Fixes #2335

Co-authored-by: Yuan Teoh <yuanteoh@google.com>
2026-01-29 23:54:21 +00:00
Wenxin Du
b6fa798610 Merge branch 'main' into err 2026-01-29 18:00:58 -05:00
duwenxin
bb58baff70 add constructors 2026-01-29 18:00:11 -05:00
Binh Tran
e995349ea0 feat(prebuiltconfigs/alloydb-omni): Implement Alloydb omni dataplane tools (#2340)
## Description

Implement Dataplane tools for alloydb omni using Postgres source and
postgres tools. I also add more omni-specific tool (columnar engine).

---------

Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2026-01-29 22:47:49 +00:00
duwenxin
32b2c9366d feat(server): add Tool call error categories 2026-01-29 12:03:53 -05:00
Mohammed Tanveer
d1358916d8 chore(ui): prevent script execution in Toolbox UI rendering (#2331)
# Defensive Security Hardening: Prevent Script Execution in Toolbox UI
Rendering

> **Note:** This issue was identified during security research and
reviewed previously.
> While typical deployments operate within a trusted configuration
model, addressing this behavior was recommended as a defense-in-depth
improvement. This PR describes the implemented fix.

## Overview

This change improves the safety of the GenAI Toolbox UI by preventing
unintended JavaScript execution when rendering values derived from tool
configuration files.

Previously, certain fields from tool definitions were rendered directly
into HTML contexts without escaping. As a result, tool definitions
containing embedded HTML or script payloads could trigger JavaScript
execution when viewed in the dashboard. While this occurs within the
same trust boundary as the configuration owner, escaping these values by
default avoids unexpected execution and improves robustness.

## Changes Implemented

### 1. New Utility
- Added `sanitize.js` which exports a strict `escapeHtml()` function.
- Escapes dangerous characters: `&`, `<`, `>`, `"`, `'`, `/`, `` ` ``.
- Performs strict type checking, rendering `null` and `undefined` values
as empty strings.

### 2. Input Handling
- Updated `internal/server/static/js/toolDisplay.js` to wrap `tool.name`
and `tool.description` with `escapeHtml()` prior to rendering them into
the DOM.

### 3. Error Handling
- Updated `internal/server/static/js/loadTools.js` to sanitize error
messages that may reflect user-controlled or derived input before
rendering.

## Validation

- Verified behavior using tool definition files containing common script
execution vectors.
- Confirmed that embedded HTML and script payloads are rendered as
literal text.
- Verified that standard and existing tool definitions continue to
render correctly without functional regression.

## Notes

This change is a defense-in-depth hardening measure.  
It does not modify the existing trust model or intended usage patterns,
but ensures safer default rendering behavior and avoids unintended
script execution in the UI.

## Attribution

**Contributor:** Mohammed Tanveer (threatpointer)

---------

Co-authored-by: threatpointer <mohammed.tanveer1@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
2026-01-29 00:22:24 +00:00
Wenxin Du
2d5d33388c refactor: remove ParseParams() from Tool interface (#2375)
The `ParseParams` Tool interface is only passing the tool's parameter
into a generic `parameters.ParseParams()` helper. Instead of keeping it
as a tool interface, we add a `GetParameters()` method
(https://github.com/googleapis/genai-toolbox/pull/2374) to the tool
interface and call it directly from the API handlers. This way we keep
the parameter parsing logic independent from the tools.
2026-01-28 23:01:13 +00:00