-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add MCP tool annotations to all remaining tools #2221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add MCP tool annotations to all remaining tools #2221
Conversation
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)
|
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.
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.
internal/tools/elasticsearch/elasticsearchesql/elasticsearchesql.go
Outdated
Show resolved
Hide resolved
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)
b147bc0 to
2619bd1
Compare
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)
|
Thanks for catching those compilation errors! Fixed in commit 5289686 - corrected the receiver reference from |
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):
Implementation pattern:
Each tool now:
Annotationsfield in its Config struct for user customizationGetAnnotationsOrDefault()withNewReadOnlyAnnotations()orNewDestructiveAnnotations()for sensible defaultsGetMcpManifest()instead ofnilAnnotation logic:
Related PRs
Test plan
go build ./...succeedsgo test ./...passes🤖 Generated with Claude Code