Commit Graph

10 Commits

Author SHA1 Message Date
Wenxin Du
4468bc920b feat: Add Map parameters support (#928)
support both generic and typed map. Config example:
```
 parameters:
      - name: user_scores
        type: map
        description: A map of user IDs to their scores. All scores must be integers.
        valueType: integer # This enforces the value type for all entries. Leave it blank for generic map

```
Represented as `Object` with `additionalProperties` in manifests.

Added a util function to convert json.Number (string type) to int/float
types to address the problem where int/float values are converted to
strings for the generic map.
2025-07-18 17:19:09 -04:00
AlexTalreja
4c240ac3c9 feat: dynamic reloading for toolbox config (#800)
Allow Toolbox server to automatically update when users modify their
tool configuration file(s), instead of requiring a restart.

This feature is automatically enabled, but can be turned off with the
flag `--disable-reload`.
2025-07-08 17:28:12 -07:00
Yuan
474df57d62 feat: support MCP version 2025-03-26 (#755)
This feature includes the following:
* Implement initialize lifecycle (including version negotiation)
* Add the v20250326 schema
* Supporting the `DELETE` and `GET` endpoint for MCP.
* Supporting streamable HTTP (without SSE).
* Terminating sessions after timeout (default = 10 minutes from last
active).
* Toolbox do not support batch request. Will response with `Invalid
requests` if batch requests is received.
2025-06-26 00:34:37 +00:00
Yuan
2b6bb99daa chore: throw an error fail to retrieve user agent (#304)
User agent will be set as "genai-toolbox/" + versionString.

Instead of a panic, Toolbox will throw an error if the source fail to
retrieve `user agent`.

This will also be consistent with setting and getting logger from
context.
2025-03-11 13:46:44 -07:00
Yuan
df28036b84 chore: add and retrieves logger from context (#301)
Add functionality to add and retrieve logger from Go context.
2025-02-21 21:28:40 +00:00
Yuan
95d29f9e8a chore: pass logger via context through unmarshaller (#300)
Passing logger via context. With this, we will be able to add logs
during the unmarshaling process.
2025-02-21 13:02:23 -08:00
Yuan
9193836eff fix: throw error when items field is missing from array parameter (#296)
Fixes #291 by throwing a more descriptive error when items field is not provided.

Example of error when `items` field not provided for array parameter:
```
2025-02-18T14:07:58.77173-08:00 ERROR "unable to parse tool file at \"tools.yaml\": unable to parse as \"postgres-sql\": unable to parse as \"array\": unable to parse 'items' field: error parsing parameters: nothing to unmarshal"
```
2025-02-18 19:52:36 -07:00
Yuan
a0ac5334d1 chore: return error for untested fields in tools.yaml (#239)
This only checks within `SourceConfig`, `ToolConfig`, and
`AuthSourceConfig`.

Error when an unknown field is provided:
`2025-01-27T22:43:46.988401-08:00 ERROR "unable to parse tool file at
\"tools.yaml\": unable to parse as \"cloud-sql-postgres\": [2:1] unknown
field \"extra\"\n 1 | database: test_database\n> 2 | extra: here\n ^\n 3
| instance: toolbox-cloudsql\n 4 | kind: cloud-sql-postgres\n 5 |
password: postgres\n 6 | "`

Error when a required field is not provided:
`2025-01-27T17:49:47.584846-08:00 ERROR "unable to parse tool file at
\"tools.yaml\": validation failed: Key: 'Config.Region' Error:Field
validation for 'Region' failed on the 'required' tag"`

---------

Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
2025-02-03 15:30:27 -08:00
Yuan
8452f8eb44 feat: add user agent to cloud databases (#244)
Add user agent to cloud databases that provides us anonymized data
request count, number of users, number of projects, and other
environment settings.

User agent is using the format: `genai-toolbox/$version+metadata`
2025-01-29 17:19:52 -08:00
Yuan
45fc046437 chore: migrate yaml library to goccy/go-yaml (#211)
Migrate yaml library from
[gopkg.in/yaml.v3](https://pkg.go.dev/gopkg.in/yaml.v3) to
[goccy/go-yaml](https://github.com/goccy/go-yaml).

We are trying to add validation feature to the unmarshaling of yaml.
However, `yaml.v3` currently does not support that and the library had
not been actively maintained for awhile. This migration will allow us to
use validation processing such as
[go-playground/validator](https://github.com/go-playground/validator)

---------

Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
2025-01-16 09:15:18 -08:00