feat: add MCP tool annotations to all remaining tools#2221
feat: add MCP tool annotations to all remaining tools#2221duwenxin99 merged 2 commits intogoogleapis:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @triepod-ai, 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 significantly enhances the system's compliance with the MCP (Managed Control Plane) specification by integrating standardized tool annotations across a broad spectrum of existing tools. This initiative aims to clearly define the operational characteristics of each tool, distinguishing between read-only and destructive actions, thereby improving overall system governance, security, and the clarity of tool behavior for users and automated systems. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request systematically adds MCP tool annotations to a large number of tools, which is a great enhancement for tool discovery and usage. The implementation follows a consistent and clean pattern, leveraging new helper functions to provide default annotations. However, I've identified two critical issues in cassandracql.go and elasticsearchesql.go where an incorrect variable is used, which will lead to compilation errors. Once these are fixed, this PR will be in excellent shape.
b147bc0 to
2619bd1
Compare
|
Thanks for catching those compilation errors! Fixed in commit 5289686 - corrected the receiver reference from |
|
/gcbrun |
|
are we merging this PR? |
|
Hi @bryankthompson, are you still interested in merging this PR? The change LGTM but the test is failing If so, you may need to rebase and fix the test issues. Thanks! |
|
Thanks for the review feedback! I've merged upstream/main to pick up the latest changes and resolved the conflicts. The previous test failure ( Let me know if there's anything else I should address! |
|
Hi @bryankthompson the changes LGTM, but we need tests to make sure the annotations are delivered correctly. |
duwenxin99
left a comment
There was a problem hiding this comment.
LGTM but tests should be added
|
Hi @duwenxin99 — Added annotation unit tests as requested. Here's what's included:
95 tool test files — each gets a
All tests pass: |
1147264 to
9fce29b
Compare
|
Hi @duwenxin99 — Rebased on upstream/main and expanded annotation coverage to all remaining tools. What changed:
Updated totals:
Every non-Looker, non-MongoDB tool with |
|
/gcbrun |
|
Hi @bryankthompson, thanks for the update! Could you please make sure all these contributors account sign the CLA? It is required for any PR to be merged that all contributors sign the CLA. Thanks! Could you also run |
Add readOnlyHint and destructiveHint annotations to all non-Looker, non-MongoDB tools using GetAnnotationsOrDefault for config-driven override support. Changes: - Added Annotations field to Config structs for YAML configuration - Added readOnlyHint: true to read-only tools (queries, fetches, lists) - Added destructiveHint: true to tools that modify data (execute, create, delete) - Applied annotations to 156 tool files across all database and service tools - Used GetAnnotationsOrDefault pattern for user-overridable defaults 🤖 Generated with [Claude Code](https://claude.com/claude-code)
7b5dd63 to
7e81e06
Compare
|
Hi @duwenxin99, thanks for the feedback! I've addressed both issues:
I also rebased onto the latest |
|
/gcbrun |
…apis#2221) ## Summary Adds MCP tool annotations (`readOnlyHint`, `destructiveHint`) to all remaining tools (excluding Looker and MongoDB which already have annotations from googleapis#2219). ## Changes - Added `Annotations *tools.ToolAnnotations` field to Config structs for YAML configuration override - Added `readOnlyHint: true` to 92 read-only tools (queries, fetches, lists, gets, searches) - Added `destructiveHint: true` to 50 tools that modify data (execute SQL, create, delete, update) - Used `GetAnnotationsOrDefault` pattern for user-overridable defaults - Applied to 156 tool files across all database and service tools ## Why This Matters Tool annotations provide semantic metadata that helps MCP clients: - Auto-approve safe (read-only) operations without user confirmation - Show appropriate warnings for destructive operations - Cache results of read-only tools more aggressively ## Classification Approach - **Read-only**: Tools that only query/fetch data (list, get, search, schema, stats) - **Destructive**: Tools that can modify data (execute SQL, create, update, delete) - General SQL execution tools marked destructive (can run arbitrary DML) - Wait/poll and compile/validate tools are read-only ## Testing - [x] `go build ./...` passes - [x] `go test ./internal/tools/...` - all tests pass - [x] `golangci-lint run --fix` - 0 issues - [x] Annotation values match actual tool behavior ## CLA Fix This push resolves the CLA check failure. Commit now authored with correct GitHub noreply email. Co-authored-by: bryankthompson <199543909+bryankthompson@users.noreply.github.com> Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com> ea09db9
…apis#2221) ## Summary Adds MCP tool annotations (`readOnlyHint`, `destructiveHint`) to all remaining tools (excluding Looker and MongoDB which already have annotations from googleapis#2219). ## Changes - Added `Annotations *tools.ToolAnnotations` field to Config structs for YAML configuration override - Added `readOnlyHint: true` to 92 read-only tools (queries, fetches, lists, gets, searches) - Added `destructiveHint: true` to 50 tools that modify data (execute SQL, create, delete, update) - Used `GetAnnotationsOrDefault` pattern for user-overridable defaults - Applied to 156 tool files across all database and service tools ## Why This Matters Tool annotations provide semantic metadata that helps MCP clients: - Auto-approve safe (read-only) operations without user confirmation - Show appropriate warnings for destructive operations - Cache results of read-only tools more aggressively ## Classification Approach - **Read-only**: Tools that only query/fetch data (list, get, search, schema, stats) - **Destructive**: Tools that can modify data (execute SQL, create, update, delete) - General SQL execution tools marked destructive (can run arbitrary DML) - Wait/poll and compile/validate tools are read-only ## Testing - [x] `go build ./...` passes - [x] `go test ./internal/tools/...` - all tests pass - [x] `golangci-lint run --fix` - 0 issues - [x] Annotation values match actual tool behavior ## CLA Fix This push resolves the CLA check failure. Commit now authored with correct GitHub noreply email. Co-authored-by: bryankthompson <199543909+bryankthompson@users.noreply.github.com> Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com> ea09db9
…apis#2221) ## Summary Adds MCP tool annotations (`readOnlyHint`, `destructiveHint`) to all remaining tools (excluding Looker and MongoDB which already have annotations from googleapis#2219). ## Changes - Added `Annotations *tools.ToolAnnotations` field to Config structs for YAML configuration override - Added `readOnlyHint: true` to 92 read-only tools (queries, fetches, lists, gets, searches) - Added `destructiveHint: true` to 50 tools that modify data (execute SQL, create, delete, update) - Used `GetAnnotationsOrDefault` pattern for user-overridable defaults - Applied to 156 tool files across all database and service tools ## Why This Matters Tool annotations provide semantic metadata that helps MCP clients: - Auto-approve safe (read-only) operations without user confirmation - Show appropriate warnings for destructive operations - Cache results of read-only tools more aggressively ## Classification Approach - **Read-only**: Tools that only query/fetch data (list, get, search, schema, stats) - **Destructive**: Tools that can modify data (execute SQL, create, update, delete) - General SQL execution tools marked destructive (can run arbitrary DML) - Wait/poll and compile/validate tools are read-only ## Testing - [x] `go build ./...` passes - [x] `go test ./internal/tools/...` - all tests pass - [x] `golangci-lint run --fix` - 0 issues - [x] Annotation values match actual tool behavior ## CLA Fix This push resolves the CLA check failure. Commit now authored with correct GitHub noreply email. Co-authored-by: bryankthompson <199543909+bryankthompson@users.noreply.github.com> Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com> ea09db9
…apis#2221) ## Summary Adds MCP tool annotations (`readOnlyHint`, `destructiveHint`) to all remaining tools (excluding Looker and MongoDB which already have annotations from googleapis#2219). ## Changes - Added `Annotations *tools.ToolAnnotations` field to Config structs for YAML configuration override - Added `readOnlyHint: true` to 92 read-only tools (queries, fetches, lists, gets, searches) - Added `destructiveHint: true` to 50 tools that modify data (execute SQL, create, delete, update) - Used `GetAnnotationsOrDefault` pattern for user-overridable defaults - Applied to 156 tool files across all database and service tools ## Why This Matters Tool annotations provide semantic metadata that helps MCP clients: - Auto-approve safe (read-only) operations without user confirmation - Show appropriate warnings for destructive operations - Cache results of read-only tools more aggressively ## Classification Approach - **Read-only**: Tools that only query/fetch data (list, get, search, schema, stats) - **Destructive**: Tools that can modify data (execute SQL, create, update, delete) - General SQL execution tools marked destructive (can run arbitrary DML) - Wait/poll and compile/validate tools are read-only ## Testing - [x] `go build ./...` passes - [x] `go test ./internal/tools/...` - all tests pass - [x] `golangci-lint run --fix` - 0 issues - [x] Annotation values match actual tool behavior ## CLA Fix This push resolves the CLA check failure. Commit now authored with correct GitHub noreply email. Co-authored-by: bryankthompson <199543909+bryankthompson@users.noreply.github.com> Co-authored-by: Wenxin Du <117315983+duwenxin99@users.noreply.github.com> ea09db9
🤖 I have created a release *beep* *boop* --- ## [0.32.0](v0.31.0...v0.32.0) (2026-04-08) ### ⚠ BREAKING CHANGES * update repo name ([#2968](#2968)) ### Features * Add MCP tool annotations to all remaining tools ([#2221](#2221)) ([ea09db9](ea09db9)) * **bigquery:** Add conversational analytics tools for Data Agents ([#2517](#2517)) ([2490a4b](2490a4b)) * **embeddingModel:** Add Backend API selection fields ([#2592](#2592)) ([912aa9e](912aa9e)) * **skills:** Add Claude Code support to generated scripts ([#2966](#2966)) ([a1609e1](a1609e1)) * **skills:** Add codex user agent ([#2973](#2973)) ([070e939](070e939)) * **skills:** Tool invocation via npx ([#2916](#2916)) ([377dc5b](377dc5b)) * **sources/singlestore:** Add ConnectionParams to SingleStore Config ([#2555](#2555)) ([73e2a8c](73e2a8c)) * **tool/dataplex-lookup-context:** Relax project constraint and enforce location ([#2952](#2952)) ([7ebfdf1](7ebfdf1)) * **tools/looker:** Looker agent management from MCP ([#2830](#2830)) ([649d4ad](649d4ad)) * **ui:** Update to use `/mcp` endpoint ([#2829](#2829)) ([c3059c2](c3059c2)) ### Bug Fixes * **bigquery:** Add impersonateServiceAccount to prebuilt config ([#2770](#2770)) ([9c3a748](9c3a748)) * **quickstart:** Robust tool lookup and modernize dependencies in Python samples ([#2863](#2863)) ([4c0845d](4c0845d)) * **skills:** Fix skill generation template ([#2914](#2914)) ([a01a15e](a01a15e)) * **skills:** Prevent empty strings overriding optional env vars in node scripts ([#2963](#2963)) ([c52adeb](c52adeb)) * **tests/bigquery:** Implement uuid-based isolation and reliable resource cleanup ([#2547](#2547)) ([479d842](479d842)) * **tests/Bigtable:** Implement uuid-based isolation and reliable resource cleanup ([#2880](#2880)) ([a769f15](a769f15)) * Update error for ConvertConfig function ([#2993](#2993)) ([62bdabb](62bdabb)) ### Code Refactoring * Update repo name ([#2968](#2968)) ([3aae809](3aae809)) --- 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* --- ## [0.32.0](v0.31.0...v0.32.0) (2026-04-08) ### ⚠ BREAKING CHANGES * update repo name ([#2968](#2968)) ### Features * Add MCP tool annotations to all remaining tools ([#2221](#2221)) ([ea09db9](ea09db9)) * **bigquery:** Add conversational analytics tools for Data Agents ([#2517](#2517)) ([2490a4b](2490a4b)) * **embeddingModel:** Add Backend API selection fields ([#2592](#2592)) ([912aa9e](912aa9e)) * **skills:** Add Claude Code support to generated scripts ([#2966](#2966)) ([a1609e1](a1609e1)) * **skills:** Add codex user agent ([#2973](#2973)) ([070e939](070e939)) * **skills:** Tool invocation via npx ([#2916](#2916)) ([377dc5b](377dc5b)) * **sources/singlestore:** Add ConnectionParams to SingleStore Config ([#2555](#2555)) ([73e2a8c](73e2a8c)) * **tool/dataplex-lookup-context:** Relax project constraint and enforce location ([#2952](#2952)) ([7ebfdf1](7ebfdf1)) * **tools/looker:** Looker agent management from MCP ([#2830](#2830)) ([649d4ad](649d4ad)) * **ui:** Update to use `/mcp` endpoint ([#2829](#2829)) ([c3059c2](c3059c2)) ### Bug Fixes * **bigquery:** Add impersonateServiceAccount to prebuilt config ([#2770](#2770)) ([9c3a748](9c3a748)) * **quickstart:** Robust tool lookup and modernize dependencies in Python samples ([#2863](#2863)) ([4c0845d](4c0845d)) * **skills:** Fix skill generation template ([#2914](#2914)) ([a01a15e](a01a15e)) * **skills:** Prevent empty strings overriding optional env vars in node scripts ([#2963](#2963)) ([c52adeb](c52adeb)) * **tests/bigquery:** Implement uuid-based isolation and reliable resource cleanup ([#2547](#2547)) ([479d842](479d842)) * **tests/Bigtable:** Implement uuid-based isolation and reliable resource cleanup ([#2880](#2880)) ([a769f15](a769f15)) * Update error for ConvertConfig function ([#2993](#2993)) ([62bdabb](62bdabb)) ### Code Refactoring * Update repo name ([#2968](#2968)) ([3aae809](3aae809)) --- 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> b9ae1c6
🤖 I have created a release *beep* *boop* --- ## [0.32.0](googleapis/mcp-toolbox@v0.31.0...v0.32.0) (2026-04-08) ### ⚠ BREAKING CHANGES * update repo name ([googleapis#2968](googleapis#2968)) ### Features * Add MCP tool annotations to all remaining tools ([googleapis#2221](googleapis#2221)) ([ea09db9](googleapis@ea09db9)) * **bigquery:** Add conversational analytics tools for Data Agents ([googleapis#2517](googleapis#2517)) ([2490a4b](googleapis@2490a4b)) * **embeddingModel:** Add Backend API selection fields ([googleapis#2592](googleapis#2592)) ([912aa9e](googleapis@912aa9e)) * **skills:** Add Claude Code support to generated scripts ([googleapis#2966](googleapis#2966)) ([a1609e1](googleapis@a1609e1)) * **skills:** Add codex user agent ([googleapis#2973](googleapis#2973)) ([070e939](googleapis@070e939)) * **skills:** Tool invocation via npx ([googleapis#2916](googleapis#2916)) ([377dc5b](googleapis@377dc5b)) * **sources/singlestore:** Add ConnectionParams to SingleStore Config ([googleapis#2555](googleapis#2555)) ([73e2a8c](googleapis@73e2a8c)) * **tool/dataplex-lookup-context:** Relax project constraint and enforce location ([googleapis#2952](googleapis#2952)) ([7ebfdf1](googleapis@7ebfdf1)) * **tools/looker:** Looker agent management from MCP ([googleapis#2830](googleapis#2830)) ([649d4ad](googleapis@649d4ad)) * **ui:** Update to use `/mcp` endpoint ([googleapis#2829](googleapis#2829)) ([c3059c2](googleapis@c3059c2)) ### Bug Fixes * **bigquery:** Add impersonateServiceAccount to prebuilt config ([googleapis#2770](googleapis#2770)) ([9c3a748](googleapis@9c3a748)) * **quickstart:** Robust tool lookup and modernize dependencies in Python samples ([googleapis#2863](googleapis#2863)) ([4c0845d](googleapis@4c0845d)) * **skills:** Fix skill generation template ([googleapis#2914](googleapis#2914)) ([a01a15e](googleapis@a01a15e)) * **skills:** Prevent empty strings overriding optional env vars in node scripts ([googleapis#2963](googleapis#2963)) ([c52adeb](googleapis@c52adeb)) * **tests/bigquery:** Implement uuid-based isolation and reliable resource cleanup ([googleapis#2547](googleapis#2547)) ([479d842](googleapis@479d842)) * **tests/Bigtable:** Implement uuid-based isolation and reliable resource cleanup ([googleapis#2880](googleapis#2880)) ([a769f15](googleapis@a769f15)) * Update error for ConvertConfig function ([googleapis#2993](googleapis#2993)) ([62bdabb](googleapis@62bdabb)) ### Code Refactoring * Update repo name ([googleapis#2968](googleapis#2968)) ([3aae809](googleapis@3aae809)) --- 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> b9ae1c6
🤖 I have created a release *beep* *boop* --- ## [0.32.0](googleapis/mcp-toolbox@v0.31.0...v0.32.0) (2026-04-08) ### ⚠ BREAKING CHANGES * update repo name ([googleapis#2968](googleapis#2968)) ### Features * Add MCP tool annotations to all remaining tools ([googleapis#2221](googleapis#2221)) ([ea09db9](googleapis@ea09db9)) * **bigquery:** Add conversational analytics tools for Data Agents ([googleapis#2517](googleapis#2517)) ([2490a4b](googleapis@2490a4b)) * **embeddingModel:** Add Backend API selection fields ([googleapis#2592](googleapis#2592)) ([912aa9e](googleapis@912aa9e)) * **skills:** Add Claude Code support to generated scripts ([googleapis#2966](googleapis#2966)) ([a1609e1](googleapis@a1609e1)) * **skills:** Add codex user agent ([googleapis#2973](googleapis#2973)) ([070e939](googleapis@070e939)) * **skills:** Tool invocation via npx ([googleapis#2916](googleapis#2916)) ([377dc5b](googleapis@377dc5b)) * **sources/singlestore:** Add ConnectionParams to SingleStore Config ([googleapis#2555](googleapis#2555)) ([73e2a8c](googleapis@73e2a8c)) * **tool/dataplex-lookup-context:** Relax project constraint and enforce location ([googleapis#2952](googleapis#2952)) ([7ebfdf1](googleapis@7ebfdf1)) * **tools/looker:** Looker agent management from MCP ([googleapis#2830](googleapis#2830)) ([649d4ad](googleapis@649d4ad)) * **ui:** Update to use `/mcp` endpoint ([googleapis#2829](googleapis#2829)) ([c3059c2](googleapis@c3059c2)) ### Bug Fixes * **bigquery:** Add impersonateServiceAccount to prebuilt config ([googleapis#2770](googleapis#2770)) ([9c3a748](googleapis@9c3a748)) * **quickstart:** Robust tool lookup and modernize dependencies in Python samples ([googleapis#2863](googleapis#2863)) ([4c0845d](googleapis@4c0845d)) * **skills:** Fix skill generation template ([googleapis#2914](googleapis#2914)) ([a01a15e](googleapis@a01a15e)) * **skills:** Prevent empty strings overriding optional env vars in node scripts ([googleapis#2963](googleapis#2963)) ([c52adeb](googleapis@c52adeb)) * **tests/bigquery:** Implement uuid-based isolation and reliable resource cleanup ([googleapis#2547](googleapis#2547)) ([479d842](googleapis@479d842)) * **tests/Bigtable:** Implement uuid-based isolation and reliable resource cleanup ([googleapis#2880](googleapis#2880)) ([a769f15](googleapis@a769f15)) * Update error for ConvertConfig function ([googleapis#2993](googleapis#2993)) ([62bdabb](googleapis@62bdabb)) ### Code Refactoring * Update repo name ([googleapis#2968](googleapis#2968)) ([3aae809](googleapis@3aae809)) --- 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> b9ae1c6

Summary
Adds MCP tool annotations (
readOnlyHint,destructiveHint) to all remaining tools (excluding Looker and MongoDB which already have annotations from #2219).Changes
Annotations *tools.ToolAnnotationsfield to Config structs for YAML configuration overridereadOnlyHint: trueto 92 read-only tools (queries, fetches, lists, gets, searches)destructiveHint: trueto 50 tools that modify data (execute SQL, create, delete, update)GetAnnotationsOrDefaultpattern for user-overridable defaultsWhy This Matters
Tool annotations provide semantic metadata that helps MCP clients:
Classification Approach
Testing
go build ./...passesgo test ./internal/tools/...- all tests passgolangci-lint run --fix- 0 issuesCLA Fix
This push resolves the CLA check failure. Commit now authored with correct GitHub noreply email.