Skip to content

Conversation

@triepod-ai
Copy link

Summary

This PR adds MCP tool annotations (per MCP specification 2025-03-26) to all remaining tools in the codebase, excluding MongoDB tools which are handled in PR #2219.

Tools annotated (137 total):

  • PostgreSQL: 23 tools (22 read-only, 1 destructive)
  • BigQuery: 10 tools (9 read-only, 1 destructive)
  • AlloyDB: 11 tools (8 read-only, 3 destructive)
  • CloudSQL: 11 tools (5 read-only, 6 destructive)
  • CloudHealthcare: 15 tools (all read-only)
  • Firestore: 9 tools (6 read-only, 3 destructive)
  • MySQL: 7 tools (6 read-only, 1 destructive)
  • Spanner: 4 tools (3 read-only, 1 destructive)
  • Neo4j: 3 tools (2 read-only, 1 destructive)
  • ClickHouse: 4 tools (3 read-only, 1 destructive)
  • Misc tools: 33 tools across Oracle, Dataplex, MSSQL, Trino, TiDB, SQLite, SingleStore, OceanBase, Firebird, Redis, Cassandra, Elasticsearch, DGraph, Bigtable, CloudMonitoring, CloudGDA, Couchbase, YugabyteDB, HTTP, Wait, Valkey, Dataform

Implementation pattern:

Each tool now:

  1. Has an Annotations field in its Config struct for user customization
  2. Uses helper functions GetAnnotationsOrDefault() with NewReadOnlyAnnotations() or NewDestructiveAnnotations() for sensible defaults
  3. Passes annotations to GetMcpManifest() instead of nil

Annotation logic:

  • Read-only tools: Query/fetch operations (SQL queries, list tables, search catalogs, etc.)
  • Destructive tools: Execute SQL statements, insert/update/delete operations

Related PRs

Test plan

  • Verify go build ./... succeeds
  • Verify go test ./... passes
  • Manual review of annotation assignments for correctness

🤖 Generated with Claude Code

Add tool annotations to all 23 PostgreSQL tools to improve LLM
decision-making with MCP specification 2025-03-26.

Changes:
- Add helper functions to tools.go for DRY annotation defaults:
  - NewReadOnlyAnnotations() for query-only tools
  - NewDestructiveAnnotations() for data-modifying tools
  - GetAnnotationsOrDefault() to use custom or default annotations
- Add Annotations field to all PostgreSQL tool Config structs
- Apply read-only annotations to 22 query tools (list*, get*, etc.)
- Apply destructive annotations to postgres-execute-sql tool

The helpers reduce per-tool annotation code from 8 lines to 1 line,
making future tool annotations cleaner and more maintainable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add tool annotations to all 10 BigQuery tools:
- 9 read-only tools: bigquery-sql, bigquery-list-table-ids,
  bigquery-list-dataset-ids, bigquery-get-table-info,
  bigquery-get-dataset-info, bigquery-search-catalog,
  bigquery-forecast, bigquery-conversational-analytics,
  bigquery-analyze-contribution
- 1 destructive tool: bigquery-execute-sql

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add tool annotations to all 11 AlloyDB tools:
- 8 read-only tools: alloydb-list-clusters, alloydb-list-instances,
  alloydb-list-users, alloydb-get-cluster, alloydb-get-instance,
  alloydb-get-user, alloydb-wait-for-operation, alloydb-ai-nl
- 3 destructive tools: alloydb-create-cluster, alloydb-create-instance,
  alloydb-create-user

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add tool annotations to all 11 CloudSQL tools:
- 5 read-only tools: cloudsql-get-instances, cloudsql-list-databases,
  cloudsql-list-instances, cloudsql-wait-for-operation,
  cloudsql-pg-upgrade-precheck
- 6 destructive tools: cloudsql-clone-instance, cloudsql-create-database,
  cloudsql-create-users, cloudsql-pg-create-instances,
  cloudsql-mysql-create-instance, cloudsql-mssql-create-instance

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add read-only tool annotations to all 15 CloudHealthcare tools
including DICOM and FHIR operations (get, list, search, fetch, retrieve).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add tool annotations to all 9 Firestore tools:
- 6 read-only tools: firestore-get-rules, firestore-get-documents,
  firestore-list-collections, firestore-query-collection,
  firestore-query, firestore-validate-rules
- 3 destructive tools: firestore-add-documents, firestore-update-document,
  firestore-delete-documents

🤖 Generated with [Claude Code](https://claude.com/claude-code)
MySQL (7 tools):
- 6 read-only: mysql-sql, mysql-list-tables, mysql-get-query-plan,
  mysql-list-active-queries, mysql-list-table-fragmentation,
  mysql-list-tables-missing-unique-indexes
- 1 destructive: mysql-execute-sql

Spanner (4 tools):
- 3 read-only: spanner-sql, spanner-list-tables, spanner-list-graphs
- 1 destructive: spanner-execute-sql

Neo4j (3 tools):
- 2 read-only: neo4j-cypher, neo4j-schema
- 1 destructive: neo4j-execute-cypher

ClickHouse (4 tools):
- 3 read-only: clickhouse-sql, clickhouse-list-tables,
  clickhouse-list-databases
- 1 destructive: clickhouse-execute-sql

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@triepod-ai triepod-ai requested review from a team as code owners December 21, 2025 19:26
@google-cla
Copy link

google-cla bot commented Dec 21, 2025

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Comprehensive Annotation Coverage: MCP tool annotations have been systematically applied to 137 tools across various database and cloud services, excluding MongoDB tools which are handled in a separate PR.
  • Standardized Annotation Logic: Each tool's configuration now includes an Annotations field for user customization. Helper functions (GetAnnotationsOrDefault, NewReadOnlyAnnotations, NewDestructiveAnnotations) are used to provide sensible defaults for read-only or destructive operations, ensuring consistent application of the MCP specification.
  • Categorized Tool Behavior: Tools are explicitly categorized as either 'read-only' (e.g., query/fetch operations) or 'destructive' (e.g., execute SQL statements, insert/update/delete operations) based on their functional impact, enhancing operational transparency and safety.

🧠 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 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.

Copy link
Contributor

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

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 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.

Add annotations to 33 remaining tools across various databases:
- Oracle (oraclesql, oracleexecutesql)
- Dataplex (dataplexlookupentry, dataplexsearchaspecttypes, dataplexsearchentries)
- MSSQL (mssqlsql, mssqllisttables, mssqlexecutesql)
- Trino (trinosql, trinoexecutesql)
- TiDB (tidbsql, tidbexecutesql)
- SQLite (sqlitesql, sqliteexecutesql)
- SingleStore (singlestoresql, singlestoreexecutesql)
- OceanBase (oceanbasesql, oceanbaseexecutesql)
- Firebird (firebirdsql, firebirdexecutesql)
- Plus: cloudgda, couchbase, yugabytedbsql, bigtable, elasticsearch,
  dgraph, cloudmonitoring, dataformcompilelocal, wait, http, valkey,
  cassandra, redis

Uses helper functions for read-only tools (NewReadOnlyAnnotations) and
destructive tools (NewDestructiveAnnotations) to reduce boilerplate.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fix compilation errors where 'cfg.Annotations' was used but the receiver
is 'c'. Also add missing Annotations field to Config structs.

Fixes issues identified by Gemini Code Assist review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@triepod-ai
Copy link
Author

Thanks for catching those compilation errors! Fixed in commit 5289686 - corrected the receiver reference from cfg.Annotations to c.Annotations in both cassandracql.go and elasticsearchesql.go, and added the missing Annotations field to their Config structs.

@Yuan325 Yuan325 added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Moderately-important priority. Fix may not be included in next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants