feat(tools/mysql): add list-table-stats-tool to list table statistics in MySQL and Cloud SQL MySQL source.#2938
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the mysql-list-table-stats tool, which provides detailed MySQL table-level statistics including size, latency, and CRUD activity. The implementation includes the tool logic, configuration for Cloud SQL and standard MySQL, documentation, and integration tests. Several issues were identified in the review: a fragile and redundant schema validation block in the tool's Invoke method should be removed, documentation headings and titles must be updated to comply with the repository's strict style guide, and the limit parameter should be capped to enforce the documented maximum of 1000. Additionally, inconsistent indentation in the Go source and a copy-pasted test function name should be corrected.
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats_test.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
Yuan325
left a comment
There was a problem hiding this comment.
Might want to update the tools list on docs/en/integrations/cloud-sql-mysql/prebuilt-configs/cloud-sql-for-mysql.md and docs/en/integrations/mysql/prebuilt-configs/mysql.md too.
Also, we'll need to update the TestPrebuiltTools() unit test in cmd/internal/config_test.go
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
Yuan325
left a comment
There was a problem hiding this comment.
remaining annotation left :) Otherwise LGTM, thank you!
internal/tools/mysql/mysqllisttablestats/mysqllisttablestats.go
Outdated
Show resolved
Hide resolved
|
/gcbrun |
|
/gcbrun |
…atistics in MySQL and Cloud SQL MySQL source. (#2938) ## Description Add the list_table_stats tool to MySQL to list table statistics. The tool display table level statistics for troubleshooting performance issues, finding hottest tables and monitoring table growth. ## 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 #2484 --------- Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> dc2c2b4
…atistics in MySQL and Cloud SQL MySQL source. (googleapis#2938) ## Description Add the list_table_stats tool to MySQL to list table statistics. The tool display table level statistics for troubleshooting performance issues, finding hottest tables and monitoring table growth. ## 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 googleapis#2484 --------- Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com> dc2c2b4
🤖 I have created a release *beep* *boop* --- ## [1.0.0](v0.32.0...v1.0.0) (2026-04-10) > [!IMPORTANT] > This is the first stable release. Please review the [UPGRADING.md](UPGRADING.md) guide for instructions on migrating from previous beta versions. ### ⚠ BREAKING CHANGES * **tools/elasticsearch:** add vector search support and remove query passing through param ([#2891](#2891)) * **tools/looker:** refactor looker-git-branch tool into 5 separate tools ([#2976](#2976)) ### Features * **auth:** Support opaque token validation for `generic` authService ([#2944](#2944)) ([c924701](c924701)) * **cloudsqlpg:** Run `SELECT 1` after successful connection attempt ([#2997](#2997)) ([6ed9700](6ed9700)) * **tools/bigquerysql:** Add semantic search support ([#2890](#2890)) ([862c396](862c396)) * **tools/elasticsearch-execute-esql:** Add Tool to execute arbitrary ES/QL queries ([#3013](#3013)) ([ae49fb7](ae49fb7)) * **tools/elasticsearch:** Add vector search support and remove query passing through param ([#2891](#2891)) ([d44e879](d44e879)) * **tools/looker:** Refactor looker-git-branch tool into 5 separate tools ([#2976](#2976)) ([b2472d4](b2472d4)) * **tools/mysql:** Add list-table-stats-tool to list table statistics in MySQL and Cloud SQL MySQL source. ([#2938](#2938)) ([dc2c2b4](dc2c2b4)) --- 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 Teoh <45984206+Yuan325@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [1.0.0](v0.32.0...v1.0.0) (2026-04-10) > [!IMPORTANT] > This is the first stable release. Please review the [UPGRADING.md](UPGRADING.md) guide for instructions on migrating from previous beta versions. ### ⚠ BREAKING CHANGES * **tools/elasticsearch:** add vector search support and remove query passing through param ([#2891](#2891)) * **tools/looker:** refactor looker-git-branch tool into 5 separate tools ([#2976](#2976)) ### Features * **auth:** Support opaque token validation for `generic` authService ([#2944](#2944)) ([c924701](c924701)) * **cloudsqlpg:** Run `SELECT 1` after successful connection attempt ([#2997](#2997)) ([6ed9700](6ed9700)) * **tools/bigquerysql:** Add semantic search support ([#2890](#2890)) ([862c396](862c396)) * **tools/elasticsearch-execute-esql:** Add Tool to execute arbitrary ES/QL queries ([#3013](#3013)) ([ae49fb7](ae49fb7)) * **tools/elasticsearch:** Add vector search support and remove query passing through param ([#2891](#2891)) ([d44e879](d44e879)) * **tools/looker:** Refactor looker-git-branch tool into 5 separate tools ([#2976](#2976)) ([b2472d4](b2472d4)) * **tools/mysql:** Add list-table-stats-tool to list table statistics in MySQL and Cloud SQL MySQL source. ([#2938](#2938)) ([dc2c2b4](dc2c2b4)) --- 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 Teoh <45984206+Yuan325@users.noreply.github.com> 8b07b2d
🤖 I have created a release *beep* *boop* --- ## [1.0.0](googleapis/mcp-toolbox@v0.32.0...v1.0.0) (2026-04-10) > [!IMPORTANT] > This is the first stable release. Please review the [UPGRADING.md](UPGRADING.md) guide for instructions on migrating from previous beta versions. ### ⚠ BREAKING CHANGES * **tools/elasticsearch:** add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) * **tools/looker:** refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ### Features * **auth:** Support opaque token validation for `generic` authService ([googleapis#2944](googleapis#2944)) ([c924701](googleapis@c924701)) * **cloudsqlpg:** Run `SELECT 1` after successful connection attempt ([googleapis#2997](googleapis#2997)) ([6ed9700](googleapis@6ed9700)) * **tools/bigquerysql:** Add semantic search support ([googleapis#2890](googleapis#2890)) ([862c396](googleapis@862c396)) * **tools/elasticsearch-execute-esql:** Add Tool to execute arbitrary ES/QL queries ([googleapis#3013](googleapis#3013)) ([ae49fb7](googleapis@ae49fb7)) * **tools/elasticsearch:** Add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) ([d44e879](googleapis@d44e879)) * **tools/looker:** Refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ([b2472d4](googleapis@b2472d4)) * **tools/mysql:** Add list-table-stats-tool to list table statistics in MySQL and Cloud SQL MySQL source. ([googleapis#2938](googleapis#2938)) ([dc2c2b4](googleapis@dc2c2b4)) --- 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 Teoh <45984206+Yuan325@users.noreply.github.com> 8b07b2d
🤖 I have created a release *beep* *boop* --- ## [1.0.0](googleapis/mcp-toolbox@v0.32.0...v1.0.0) (2026-04-10) > [!IMPORTANT] > This is the first stable release. Please review the [UPGRADING.md](UPGRADING.md) guide for instructions on migrating from previous beta versions. ### ⚠ BREAKING CHANGES * **tools/elasticsearch:** add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) * **tools/looker:** refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ### Features * **auth:** Support opaque token validation for `generic` authService ([googleapis#2944](googleapis#2944)) ([c924701](googleapis@c924701)) * **cloudsqlpg:** Run `SELECT 1` after successful connection attempt ([googleapis#2997](googleapis#2997)) ([6ed9700](googleapis@6ed9700)) * **tools/bigquerysql:** Add semantic search support ([googleapis#2890](googleapis#2890)) ([862c396](googleapis@862c396)) * **tools/elasticsearch-execute-esql:** Add Tool to execute arbitrary ES/QL queries ([googleapis#3013](googleapis#3013)) ([ae49fb7](googleapis@ae49fb7)) * **tools/elasticsearch:** Add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) ([d44e879](googleapis@d44e879)) * **tools/looker:** Refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ([b2472d4](googleapis@b2472d4)) * **tools/mysql:** Add list-table-stats-tool to list table statistics in MySQL and Cloud SQL MySQL source. ([googleapis#2938](googleapis#2938)) ([dc2c2b4](googleapis@dc2c2b4)) --- 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 Teoh <45984206+Yuan325@users.noreply.github.com> 8b07b2d
🤖 I have created a release *beep* *boop* --- ## [1.0.0](googleapis/mcp-toolbox@v0.32.0...v1.0.0) (2026-04-10) > [!IMPORTANT] > This is the first stable release. Please review the [UPGRADING.md](UPGRADING.md) guide for instructions on migrating from previous beta versions. ### ⚠ BREAKING CHANGES * **tools/elasticsearch:** add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) * **tools/looker:** refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ### Features * **auth:** Support opaque token validation for `generic` authService ([googleapis#2944](googleapis#2944)) ([c924701](googleapis@c924701)) * **cloudsqlpg:** Run `SELECT 1` after successful connection attempt ([googleapis#2997](googleapis#2997)) ([6ed9700](googleapis@6ed9700)) * **tools/bigquerysql:** Add semantic search support ([googleapis#2890](googleapis#2890)) ([862c396](googleapis@862c396)) * **tools/elasticsearch-execute-esql:** Add Tool to execute arbitrary ES/QL queries ([googleapis#3013](googleapis#3013)) ([ae49fb7](googleapis@ae49fb7)) * **tools/elasticsearch:** Add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) ([d44e879](googleapis@d44e879)) * **tools/looker:** Refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ([b2472d4](googleapis@b2472d4)) * **tools/mysql:** Add list-table-stats-tool to list table statistics in MySQL and Cloud SQL MySQL source. ([googleapis#2938](googleapis#2938)) ([dc2c2b4](googleapis@dc2c2b4)) --- 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 Teoh <45984206+Yuan325@users.noreply.github.com> 8b07b2d
🤖 I have created a release *beep* *boop* --- ## [1.0.0](googleapis/mcp-toolbox@v0.32.0...v1.0.0) (2026-04-10) > [!IMPORTANT] > This is the first stable release. Please review the [UPGRADING.md](UPGRADING.md) guide for instructions on migrating from previous beta versions. ### ⚠ BREAKING CHANGES * **tools/elasticsearch:** add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) * **tools/looker:** refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ### Features * **auth:** Support opaque token validation for `generic` authService ([googleapis#2944](googleapis#2944)) ([c924701](googleapis@c924701)) * **cloudsqlpg:** Run `SELECT 1` after successful connection attempt ([googleapis#2997](googleapis#2997)) ([6ed9700](googleapis@6ed9700)) * **tools/bigquerysql:** Add semantic search support ([googleapis#2890](googleapis#2890)) ([862c396](googleapis@862c396)) * **tools/elasticsearch-execute-esql:** Add Tool to execute arbitrary ES/QL queries ([googleapis#3013](googleapis#3013)) ([ae49fb7](googleapis@ae49fb7)) * **tools/elasticsearch:** Add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) ([d44e879](googleapis@d44e879)) * **tools/looker:** Refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ([b2472d4](googleapis@b2472d4)) * **tools/mysql:** Add list-table-stats-tool to list table statistics in MySQL and Cloud SQL MySQL source. ([googleapis#2938](googleapis#2938)) ([dc2c2b4](googleapis@dc2c2b4)) --- 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 Teoh <45984206+Yuan325@users.noreply.github.com> 8b07b2d
🤖 I have created a release *beep* *boop* --- ## [1.0.0](googleapis/mcp-toolbox@v0.32.0...v1.0.0) (2026-04-10) > [!IMPORTANT] > This is the first stable release. Please review the [UPGRADING.md](UPGRADING.md) guide for instructions on migrating from previous beta versions. ### ⚠ BREAKING CHANGES * **tools/elasticsearch:** add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) * **tools/looker:** refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ### Features * **auth:** Support opaque token validation for `generic` authService ([googleapis#2944](googleapis#2944)) ([c924701](googleapis@c924701)) * **cloudsqlpg:** Run `SELECT 1` after successful connection attempt ([googleapis#2997](googleapis#2997)) ([6ed9700](googleapis@6ed9700)) * **tools/bigquerysql:** Add semantic search support ([googleapis#2890](googleapis#2890)) ([862c396](googleapis@862c396)) * **tools/elasticsearch-execute-esql:** Add Tool to execute arbitrary ES/QL queries ([googleapis#3013](googleapis#3013)) ([ae49fb7](googleapis@ae49fb7)) * **tools/elasticsearch:** Add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) ([d44e879](googleapis@d44e879)) * **tools/looker:** Refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ([b2472d4](googleapis@b2472d4)) * **tools/mysql:** Add list-table-stats-tool to list table statistics in MySQL and Cloud SQL MySQL source. ([googleapis#2938](googleapis#2938)) ([dc2c2b4](googleapis@dc2c2b4)) --- 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 Teoh <45984206+Yuan325@users.noreply.github.com> 8b07b2d
… in MySQL and Cloud SQL MySQL source. (googleapis#2938) ## Description Add the list_table_stats tool to MySQL to list table statistics. The tool display table level statistics for troubleshooting performance issues, finding hottest tables and monitoring table growth. ## 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 googleapis#2484 --------- Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [1.0.0](googleapis/mcp-toolbox@v0.32.0...v1.0.0) (2026-04-10) > [!IMPORTANT] > This is the first stable release. Please review the [UPGRADING.md](UPGRADING.md) guide for instructions on migrating from previous beta versions. ### ⚠ BREAKING CHANGES * **tools/elasticsearch:** add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) * **tools/looker:** refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ### Features * **auth:** Support opaque token validation for `generic` authService ([googleapis#2944](googleapis#2944)) ([c924701](googleapis@c924701)) * **cloudsqlpg:** Run `SELECT 1` after successful connection attempt ([googleapis#2997](googleapis#2997)) ([6ed9700](googleapis@6ed9700)) * **tools/bigquerysql:** Add semantic search support ([googleapis#2890](googleapis#2890)) ([862c396](googleapis@862c396)) * **tools/elasticsearch-execute-esql:** Add Tool to execute arbitrary ES/QL queries ([googleapis#3013](googleapis#3013)) ([ae49fb7](googleapis@ae49fb7)) * **tools/elasticsearch:** Add vector search support and remove query passing through param ([googleapis#2891](googleapis#2891)) ([d44e879](googleapis@d44e879)) * **tools/looker:** Refactor looker-git-branch tool into 5 separate tools ([googleapis#2976](googleapis#2976)) ([b2472d4](googleapis@b2472d4)) * **tools/mysql:** Add list-table-stats-tool to list table statistics in MySQL and Cloud SQL MySQL source. ([googleapis#2938](googleapis#2938)) ([dc2c2b4](googleapis@dc2c2b4)) --- 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 Teoh <45984206+Yuan325@users.noreply.github.com>
Description
Add the list_table_stats tool to MySQL to list table statistics.
The tool display table level statistics for troubleshooting performance issues, finding hottest tables and monitoring table growth.
PR Checklist
CONTRIBUTING.md
bug/issue
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
!if this involve a breaking change🛠️ Fixes #2484