Skip to content

feat: add support for optional parameters - #617

Merged
Yuan325 merged 4 commits into
mainfrom
optional-params
Jun 20, 2025
Merged

Yuan325 merged 4 commits into
mainfrom
optional-params

Conversation

@Yuan325

@Yuan325 Yuan325 commented May 27, 2025 •

Copy link
Copy Markdown
Contributor

Add a default field to parameters, that enables users to specify a default value.

e.g.

  parameters:
    - name: name
      type: string
      default: "some-default-value"
      description: The name of the hotel.

if this parameter is invoked without specifying name, the parameter would default to "some-default-value"

For parameter manifest, there will be an additional Required field. The default Required field is true. If a default value is presented, Required: false. Array parameter's item's Required field will inherit the array's Required field.

Fixes #475

@Yuan325
Yuan325 requested a review from a team May 27, 2025 20:26
@Yuan325
Yuan325 force-pushed the optional-params branch 2 times, most recently from 39f733b to 612487a Compare May 27, 2025 20:43
Comment thread internal/tools/parameters.go Outdated
Comment thread internal/server/common_test.go
Comment thread internal/tools/parameters.go Outdated
Comment thread internal/tools/parameters.go Outdated
jeffreyrubi pushed a commit to jeffreyrubi/genai-toolbox that referenced this pull request Jun 7, 2025
@Yuan325
Yuan325 force-pushed the optional-params branch 2 times, most recently from 9a9e660 to 8dba93f Compare June 10, 2025 20:56
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@Yuan325
Yuan325 merged commit 4827771 into main Jun 20, 2025
@Yuan325
Yuan325 deleted the optional-params branch June 20, 2025 17:47
@github-actions

Copy link
Copy Markdown
Contributor

🧨 Preview deployments removed.

github-actions Bot pushed a commit that referenced this pull request Jun 20, 2025
Add a `default` field to parameters, that enables users to specify a
default value.

e.g.

```
  parameters:
    - name: name
      type: string
      default: "some-default-value"
      description: The name of the hotel.
```
if this parameter is invoked without specifying `name`, the parameter
would default to "some-default-value"

For parameter manifest, there will be an additional `Required` field.
The default `Required` field is true. If a `default` value is presented,
`Required: false`. Array parameter's item's `Required` field will
inherit the array's `Required` field.

Fixes #475 4827771
github-actions Bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Jun 20, 2025
Add a `default` field to parameters, that enables users to specify a
default value.

e.g.

```
  parameters:
    - name: name
      type: string
      default: "some-default-value"
      description: The name of the hotel.
```
if this parameter is invoked without specifying `name`, the parameter
would default to "some-default-value"

For parameter manifest, there will be an additional `Required` field.
The default `Required` field is true. If a `default` value is presented,
`Required: false`. Array parameter's item's `Required` field will
inherit the array's `Required` field.

Fixes googleapis#475 4827771
anubhav756 added a commit to GoogleCloudPlatform/cymbal-air-toolbox-demo that referenced this pull request Jun 26, 2025
This PR adds a tools file equivalent to all the tools in the Cymbal Air
app.

> [!NOTE]
> This tools file makes use of the new optional params feature
(`default: ""`) from
[#617](googleapis/mcp-toolbox#617).
duwenxin99 pushed a commit to dennisg/genai-toolbox that referenced this pull request Jul 1, 2025
Add a `default` field to parameters, that enables users to specify a
default value.

e.g.

```
  parameters:
    - name: name
      type: string
      default: "some-default-value"
      description: The name of the hotel.
```
if this parameter is invoked without specifying `name`, the parameter
would default to "some-default-value"


For parameter manifest, there will be an additional `Required` field.
The default `Required` field is true. If a `default` value is presented,
`Required: false`. Array parameter's item's `Required` field will
inherit the array's `Required` field.

Fixes googleapis#475
Yuan325 added a commit that referenced this pull request Jul 2, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.8.0](v0.7.0...v0.8.0)
(2025-07-02)


### ⚠ BREAKING CHANGES

* **postgres,mssql,cloudsqlmssql:** encode source connection url for
sources ([#727](#727))

### Features

* Add support for multiple YAML configuration files
([#760](#760))
([40679d7](40679d7))
* Add support for optional parameters
([#617](#617))
([4827771](4827771)),
closes [#475](#475)
* **mcp:** Support MCP version 2025-03-26
([#755](#755))
([474df57](474df57))
* **sources/http:** Support disable SSL verification for HTTP Source
([#674](#674))
([4055b0c](4055b0c))
* **tools/bigquery:** Add templateParameters field for bigquery
([#699](#699))
([f5f771b](f5f771b))
* **tools/bigtable:** Add templateParameters field for bigtable
([#692](#692))
([1c06771](1c06771))
* **tools/couchbase:** Add templateParameters field for couchbase
([#723](#723))
([9197186](9197186))
* **tools/http:** Add support for HTTP Tool pathParams
([#726](#726))
([fd300dc](fd300dc))
* **tools/redis:** Add Redis Source and Tool
([#519](#519))
([f0aef29](f0aef29))
* **tools/spanner:** Add templateParameters field for spanner
([#691](#691))
([075dfa4](075dfa4))
* **tools/sqlitesql:** Add templateParameters field for sqlitesql
([#687](#687))
([75e254c](75e254c))
* **tools/valkey:** Add Valkey Source and Tool
([#532](#532))
([054ec19](054ec19))


### Bug Fixes

* **bigquery,mssql:** Fix panic on tools with array param
([#722](#722))
([7a6644c](7a6644c))
* **postgres,mssql,cloudsqlmssql:** Encode source connection url for
sources ([#727](#727))
([67964d9](67964d9)),
closes [#717](#717)
* Set default value to field's type during unmarshalling
([#774](#774))
([fafed24](fafed24)),
closes [#771](#771)
* **server/mcp:** Do not listen from port for stdio
([#719](#719))
([d51dbc7](d51dbc7)),
closes [#711](#711)
* **tools/mysqlexecutesql:** Handle nil panic and connection leak in
Invoke ([#757](#757))
([7badba4](7badba4))
* **tools/mysqlsql:** Handle nil panic and connection leak in invoke
([#758](#758))
([cbb4a33](cbb4a33))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan <45984206+Yuan325@users.noreply.github.com>
github-actions Bot pushed a commit that referenced this pull request Jul 2, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.8.0](v0.7.0...v0.8.0)
(2025-07-02)

### ⚠ BREAKING CHANGES

* **postgres,mssql,cloudsqlmssql:** encode source connection url for
sources ([#727](#727))

### Features

* Add support for multiple YAML configuration files
([#760](#760))
([40679d7](40679d7))
* Add support for optional parameters
([#617](#617))
([4827771](4827771)),
closes [#475](#475)
* **mcp:** Support MCP version 2025-03-26
([#755](#755))
([474df57](474df57))
* **sources/http:** Support disable SSL verification for HTTP Source
([#674](#674))
([4055b0c](4055b0c))
* **tools/bigquery:** Add templateParameters field for bigquery
([#699](#699))
([f5f771b](f5f771b))
* **tools/bigtable:** Add templateParameters field for bigtable
([#692](#692))
([1c06771](1c06771))
* **tools/couchbase:** Add templateParameters field for couchbase
([#723](#723))
([9197186](9197186))
* **tools/http:** Add support for HTTP Tool pathParams
([#726](#726))
([fd300dc](fd300dc))
* **tools/redis:** Add Redis Source and Tool
([#519](#519))
([f0aef29](f0aef29))
* **tools/spanner:** Add templateParameters field for spanner
([#691](#691))
([075dfa4](075dfa4))
* **tools/sqlitesql:** Add templateParameters field for sqlitesql
([#687](#687))
([75e254c](75e254c))
* **tools/valkey:** Add Valkey Source and Tool
([#532](#532))
([054ec19](054ec19))

### Bug Fixes

* **bigquery,mssql:** Fix panic on tools with array param
([#722](#722))
([7a6644c](7a6644c))
* **postgres,mssql,cloudsqlmssql:** Encode source connection url for
sources ([#727](#727))
([67964d9](67964d9)),
closes [#717](#717)
* Set default value to field's type during unmarshalling
([#774](#774))
([fafed24](fafed24)),
closes [#771](#771)
* **server/mcp:** Do not listen from port for stdio
([#719](#719))
([d51dbc7](d51dbc7)),
closes [#711](#711)
* **tools/mysqlexecutesql:** Handle nil panic and connection leak in
Invoke ([#757](#757))
([7badba4](7badba4))
* **tools/mysqlsql:** Handle nil panic and connection leak in invoke
([#758](#758))
([cbb4a33](cbb4a33))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan <45984206+Yuan325@users.noreply.github.com> f13e963
github-actions Bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Jul 2, 2025
🤖 I have created a release *beep* *boop*
---

##
[0.8.0](googleapis/mcp-toolbox@v0.7.0...v0.8.0)
(2025-07-02)

### ⚠ BREAKING CHANGES

* **postgres,mssql,cloudsqlmssql:** encode source connection url for
sources ([googleapis#727](googleapis#727))

### Features

* Add support for multiple YAML configuration files
([googleapis#760](googleapis#760))
([40679d7](googleapis@40679d7))
* Add support for optional parameters
([googleapis#617](googleapis#617))
([4827771](googleapis@4827771)),
closes [googleapis#475](googleapis#475)
* **mcp:** Support MCP version 2025-03-26
([googleapis#755](googleapis#755))
([474df57](googleapis@474df57))
* **sources/http:** Support disable SSL verification for HTTP Source
([googleapis#674](googleapis#674))
([4055b0c](googleapis@4055b0c))
* **tools/bigquery:** Add templateParameters field for bigquery
([googleapis#699](googleapis#699))
([f5f771b](googleapis@f5f771b))
* **tools/bigtable:** Add templateParameters field for bigtable
([googleapis#692](googleapis#692))
([1c06771](googleapis@1c06771))
* **tools/couchbase:** Add templateParameters field for couchbase
([googleapis#723](googleapis#723))
([9197186](googleapis@9197186))
* **tools/http:** Add support for HTTP Tool pathParams
([googleapis#726](googleapis#726))
([fd300dc](googleapis@fd300dc))
* **tools/redis:** Add Redis Source and Tool
([googleapis#519](googleapis#519))
([f0aef29](googleapis@f0aef29))
* **tools/spanner:** Add templateParameters field for spanner
([googleapis#691](googleapis#691))
([075dfa4](googleapis@075dfa4))
* **tools/sqlitesql:** Add templateParameters field for sqlitesql
([googleapis#687](googleapis#687))
([75e254c](googleapis@75e254c))
* **tools/valkey:** Add Valkey Source and Tool
([googleapis#532](googleapis#532))
([054ec19](googleapis@054ec19))

### Bug Fixes

* **bigquery,mssql:** Fix panic on tools with array param
([googleapis#722](googleapis#722))
([7a6644c](googleapis@7a6644c))
* **postgres,mssql,cloudsqlmssql:** Encode source connection url for
sources ([googleapis#727](googleapis#727))
([67964d9](googleapis@67964d9)),
closes [googleapis#717](googleapis#717)
* Set default value to field's type during unmarshalling
([googleapis#774](googleapis#774))
([fafed24](googleapis@fafed24)),
closes [googleapis#771](googleapis#771)
* **server/mcp:** Do not listen from port for stdio
([googleapis#719](googleapis#719))
([d51dbc7](googleapis@d51dbc7)),
closes [googleapis#711](googleapis#711)
* **tools/mysqlexecutesql:** Handle nil panic and connection leak in
Invoke ([googleapis#757](googleapis#757))
([7badba4](googleapis@7badba4))
* **tools/mysqlsql:** Handle nil panic and connection leak in invoke
([googleapis#758](googleapis#758))
([cbb4a33](googleapis@cbb4a33))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan <45984206+Yuan325@users.noreply.github.com> f13e963
duwenxin99 pushed a commit that referenced this pull request Jul 2, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.8.0](v0.7.0...v0.8.0)
(2025-07-02)


### ⚠ BREAKING CHANGES

* **postgres,mssql,cloudsqlmssql:** encode source connection url for
sources ([#727](#727))

### Features

* Add support for multiple YAML configuration files
([#760](#760))
([40679d7](40679d7))
* Add support for optional parameters
([#617](#617))
([4827771](4827771)),
closes [#475](#475)
* **mcp:** Support MCP version 2025-03-26
([#755](#755))
([474df57](474df57))
* **sources/http:** Support disable SSL verification for HTTP Source
([#674](#674))
([4055b0c](4055b0c))
* **tools/bigquery:** Add templateParameters field for bigquery
([#699](#699))
([f5f771b](f5f771b))
* **tools/bigtable:** Add templateParameters field for bigtable
([#692](#692))
([1c06771](1c06771))
* **tools/couchbase:** Add templateParameters field for couchbase
([#723](#723))
([9197186](9197186))
* **tools/http:** Add support for HTTP Tool pathParams
([#726](#726))
([fd300dc](fd300dc))
* **tools/redis:** Add Redis Source and Tool
([#519](#519))
([f0aef29](f0aef29))
* **tools/spanner:** Add templateParameters field for spanner
([#691](#691))
([075dfa4](075dfa4))
* **tools/sqlitesql:** Add templateParameters field for sqlitesql
([#687](#687))
([75e254c](75e254c))
* **tools/valkey:** Add Valkey Source and Tool
([#532](#532))
([054ec19](054ec19))


### Bug Fixes

* **bigquery,mssql:** Fix panic on tools with array param
([#722](#722))
([7a6644c](7a6644c))
* **postgres,mssql,cloudsqlmssql:** Encode source connection url for
sources ([#727](#727))
([67964d9](67964d9)),
closes [#717](#717)
* Set default value to field's type during unmarshalling
([#774](#774))
([fafed24](fafed24)),
closes [#771](#771)
* **server/mcp:** Do not listen from port for stdio
([#719](#719))
([d51dbc7](d51dbc7)),
closes [#711](#711)
* **tools/mysqlexecutesql:** Handle nil panic and connection leak in
Invoke ([#757](#757))
([7badba4](7badba4))
* **tools/mysqlsql:** Handle nil panic and connection leak in invoke
([#758](#758))
([cbb4a33](cbb4a33))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan <45984206+Yuan325@users.noreply.github.com>
NightStack15 added a commit to NightStack15/googleapis-_-genai-toolbox that referenced this pull request Mar 20, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.8.0](googleapis/mcp-toolbox@v0.7.0...v0.8.0)
(2025-07-02)


### ⚠ BREAKING CHANGES

* **postgres,mssql,cloudsqlmssql:** encode source connection url for
sources ([#727](googleapis/mcp-toolbox#727))

### Features

* Add support for multiple YAML configuration files
([#760](googleapis/mcp-toolbox#760))
([40679d7](googleapis/mcp-toolbox@40679d7))
* Add support for optional parameters
([#617](googleapis/mcp-toolbox#617))
([4827771](googleapis/mcp-toolbox@4827771)),
closes [#475](googleapis/mcp-toolbox#475)
* **mcp:** Support MCP version 2025-03-26
([#755](googleapis/mcp-toolbox#755))
([474df57](googleapis/mcp-toolbox@474df57))
* **sources/http:** Support disable SSL verification for HTTP Source
([#674](googleapis/mcp-toolbox#674))
([4055b0c](googleapis/mcp-toolbox@4055b0c))
* **tools/bigquery:** Add templateParameters field for bigquery
([#699](googleapis/mcp-toolbox#699))
([f5f771b](googleapis/mcp-toolbox@f5f771b))
* **tools/bigtable:** Add templateParameters field for bigtable
([#692](googleapis/mcp-toolbox#692))
([1c06771](googleapis/mcp-toolbox@1c06771))
* **tools/couchbase:** Add templateParameters field for couchbase
([#723](googleapis/mcp-toolbox#723))
([9197186](googleapis/mcp-toolbox@9197186))
* **tools/http:** Add support for HTTP Tool pathParams
([#726](googleapis/mcp-toolbox#726))
([fd300dc](googleapis/mcp-toolbox@fd300dc))
* **tools/redis:** Add Redis Source and Tool
([#519](googleapis/mcp-toolbox#519))
([f0aef29](googleapis/mcp-toolbox@f0aef29))
* **tools/spanner:** Add templateParameters field for spanner
([#691](googleapis/mcp-toolbox#691))
([075dfa4](googleapis/mcp-toolbox@075dfa4))
* **tools/sqlitesql:** Add templateParameters field for sqlitesql
([#687](googleapis/mcp-toolbox#687))
([75e254c](googleapis/mcp-toolbox@75e254c))
* **tools/valkey:** Add Valkey Source and Tool
([#532](googleapis/mcp-toolbox#532))
([054ec19](googleapis/mcp-toolbox@054ec19))


### Bug Fixes

* **bigquery,mssql:** Fix panic on tools with array param
([#722](googleapis/mcp-toolbox#722))
([7a6644c](googleapis/mcp-toolbox@7a6644c))
* **postgres,mssql,cloudsqlmssql:** Encode source connection url for
sources ([#727](googleapis/mcp-toolbox#727))
([67964d9](googleapis/mcp-toolbox@67964d9)),
closes [#717](googleapis/mcp-toolbox#717)
* Set default value to field's type during unmarshalling
([#774](googleapis/mcp-toolbox#774))
([fafed24](googleapis/mcp-toolbox@fafed24)),
closes [#771](googleapis/mcp-toolbox#771)
* **server/mcp:** Do not listen from port for stdio
([#719](googleapis/mcp-toolbox#719))
([d51dbc7](googleapis/mcp-toolbox@d51dbc7)),
closes [#711](googleapis/mcp-toolbox#711)
* **tools/mysqlexecutesql:** Handle nil panic and connection leak in
Invoke ([#757](googleapis/mcp-toolbox#757))
([7badba4](googleapis/mcp-toolbox@7badba4))
* **tools/mysqlsql:** Handle nil panic and connection leak in invoke
([#758](googleapis/mcp-toolbox#758))
([cbb4a33](googleapis/mcp-toolbox@cbb4a33))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Yuan <45984206+Yuan325@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for optional parameters

3 participants