Skip to content

refactor: Add GetParameters() to Tools interface#2374

Merged
duwenxin99 merged 3 commits into
mainfrom
refactor-parse
Jan 27, 2026
Merged

refactor: Add GetParameters() to Tools interface#2374
duwenxin99 merged 3 commits into
mainfrom
refactor-parse

Conversation

@duwenxin99

@duwenxin99 duwenxin99 commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

As a first part to refactor the ParseParam() method of the Tool interface.

@duwenxin99 duwenxin99 requested review from a team January 27, 2026 19:14
@duwenxin99 duwenxin99 changed the title refactor: Remove ParaseParams() from Tools refactor: Add GetParameters() to Tools interface Jan 27, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @duwenxin99, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant refactoring to standardize parameter management across the toolset. By adding a GetParameters() method to the core Tool interface and implementing it widely, the PR enables a more consistent and centralized approach to defining, parsing, and embedding tool parameters. This change aims to improve code maintainability and reduce boilerplate in individual tool implementations by delegating parameter handling to common utility functions.

Highlights

  • Interface Update: The tools.Tool interface has been extended with a new method, GetParameters() parameters.Parameters, to standardize how tools expose their parameter definitions.
  • Parameter Handling Refactor: Numerous tool implementations across various sub-packages (e.g., AlloyDB, Cloud Healthcare, Cloud SQL, MongoDB, MySQL, PostgreSQL, Spanner, etc.) have been updated to implement the new GetParameters() method. This change centralizes the parameter schema access.
  • Standardized Parameter Parsing: In postgreslistavailableextensions.go, the ParseParams and EmbedParams methods were refactored to utilize the newly exposed t.Parameters via helper functions in the parameters package, moving parameter parsing and embedding logic to a common utility.
  • Minor Fix: A typo in an import path (github.comcom/googleapis to github.com/googleapis) was corrected in postgreslistavailableextensions.go.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Tool interface by adding a new GetParameters() method, and implements this method across various tool files. This change standardizes how tool parameters are accessed, which is a good step towards improving the overall architecture and maintainability. I've identified a couple of critical issues related to typos that need to be addressed.

Comment thread internal/tools/singlestore/singlestoreexecutesql/singlestoreexecutesql.go Outdated
@duwenxin99 duwenxin99 requested review from a team January 27, 2026 21:51
@duwenxin99 duwenxin99 merged commit cf477b5 into main Jan 27, 2026
12 checks passed
@duwenxin99 duwenxin99 deleted the refactor-parse branch January 27, 2026 22:27
duwenxin99 added a commit that referenced this pull request Jan 28, 2026
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
(#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.
github-actions Bot pushed a commit to Jaleel-zhu/genai-toolbox that referenced this pull request Jan 28, 2026
…pis#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
(googleapis#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. 2d5d333
kshalu-code pushed a commit to kshalu-code/genai-toolbox that referenced this pull request Feb 4, 2026
As a first part to refactor the `ParseParam()` method of the Tool
interface.
kshalu-code pushed a commit to kshalu-code/genai-toolbox that referenced this pull request Feb 4, 2026
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
(googleapis#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.
dumians pushed a commit to dumians/genai-toolbox that referenced this pull request Feb 18, 2026
As a first part to refactor the `ParseParam()` method of the Tool
interface.
dumians pushed a commit to dumians/genai-toolbox that referenced this pull request Feb 18, 2026
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
(googleapis#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.
NightStack15 added a commit to NightStack15/googleapis-_-genai-toolbox that referenced this pull request Mar 20, 2026
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
(googleapis/mcp-toolbox#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.
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.

3 participants