Commit ac21335
feat: support for annotations (#2007)
## Description
The MCP spec supports tool annotations like the below structure in the
2025-06-18 version of the spec.
https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations
```
{
destructiveHint?: boolean;
idempotentHint?: boolean;
openWorldHint?: boolean;
readOnlyHint?: boolean;
}
```
Added a ToolAnnotations structure, an Annotations member to the
McpManifest structure, and a nil initializer for the Annotations member
to all calls to GetMcpManifest.
The ToolAnnotations structure and the member annotations are all defined
as pointers so that they are omited when not set. There are times when
the zero value is meaningful so this was the only way to make sure that
we distinguish between not setting the annotation and setting it with a
zero value.
## 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 #927
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>1 parent 9234790 commit ac21335
167 files changed
Lines changed: 498 additions & 342 deletions
File tree
- internal
- prebuiltconfigs/tools
- server/mcp
- v20241105
- v20250326
- tools
- alloydbainl
- alloydb
- alloydbcreatecluster
- alloydbcreateinstance
- alloydbcreateuser
- alloydbgetcluster
- alloydbgetinstance
- alloydbgetuser
- alloydblistclusters
- alloydblistinstances
- alloydblistusers
- alloydbwaitforoperation
- bigquery
- bigqueryanalyzecontribution
- bigqueryconversationalanalytics
- bigqueryexecutesql
- bigqueryforecast
- bigquerygetdatasetinfo
- bigquerygettableinfo
- bigquerylistdatasetids
- bigquerylisttableids
- bigquerysearchcatalog
- bigquerysql
- bigtable
- cassandra/cassandracql
- clickhouse
- clickhouseexecutesql
- clickhouselistdatabases
- clickhouselisttables
- clickhousesql
- cloudhealthcare
- cloudhealthcarefhirfetchpage
- cloudhealthcarefhirpatienteverything
- cloudhealthcarefhirpatientsearch
- cloudhealthcaregetdataset
- cloudhealthcaregetdicomstoremetrics
- cloudhealthcaregetdicomstore
- cloudhealthcaregetfhirresource
- cloudhealthcaregetfhirstoremetrics
- cloudhealthcaregetfhirstore
- cloudhealthcarelistdicomstores
- cloudhealthcarelistfhirstores
- cloudhealthcareretrieverendereddicominstance
- cloudhealthcaresearchdicominstances
- cloudhealthcaresearchdicomseries
- cloudhealthcaresearchdicomstudies
- cloudmonitoring
- cloudsqlmssql/cloudsqlmssqlcreateinstance
- cloudsqlmysql/cloudsqlmysqlcreateinstance
- cloudsqlpg
- cloudsqlpgcreateinstances
- cloudsqlpgupgradeprecheck
- cloudsql
- cloudsqlcreatedatabase
- cloudsqlcreateusers
- cloudsqlgetinstances
- cloudsqllistdatabases
- cloudsqllistinstances
- cloudsqlwaitforoperation
- couchbase
- dataform/dataformcompilelocal
- dataplex
- dataplexlookupentry
- dataplexsearchaspecttypes
- dataplexsearchentries
- dgraph
- elasticsearch/elasticsearchesql
- firebird
- firebirdexecutesql
- firebirdsql
- firestore
- firestoreadddocuments
- firestoredeletedocuments
- firestoregetdocuments
- firestoregetrules
- firestorelistcollections
- firestorequerycollection
- firestorequery
- firestoreupdatedocument
- firestorevalidaterules
- http
- looker
- lookeradddashboardelement
- lookerconversationalanalytics
- lookercreateprojectfile
- lookerdeleteprojectfile
- lookerdevmode
- lookergenerateembedurl
- lookergetconnectiondatabases
- lookergetconnectionschemas
- lookergetconnections
- lookergetconnectiontablecolumns
- lookergetconnectiontables
- lookergetdashboards
- lookergetdimensions
- lookergetexplores
- lookergetfilters
- lookergetlooks
- lookergetmeasures
- lookergetmodels
- lookergetparameters
- lookergetprojectfiles
- lookergetprojectfile
- lookergetprojects
- lookerhealthanalyze
- lookerhealthpulse
- lookerhealthvacuum
- lookermakedashboard
- lookermakelook
- lookerquerysql
- lookerqueryurl
- lookerquery
- lookerrundashboard
- lookerrunlook
- lookerupdateprojectfile
- mongodb
- mongodbaggregate
- mongodbdeletemany
- mongodbdeleteone
- mongodbfindone
- mongodbfind
- mongodbinsertmany
- mongodbinsertone
- mongodbupdatemany
- mongodbupdateone
- mssql
- mssqlexecutesql
- mssqllisttables
- mssqlsql
- mysql
- mysqlexecutesql
- mysqllistactivequeries
- mysqllisttablefragmentation
- mysqllisttablesmissinguniqueindexes
- mysqllisttables
- mysqlsql
- neo4j
- neo4jcypher
- neo4jexecutecypher
- neo4jschema
- oceanbase
- oceanbaseexecutesql
- oceanbasesql
- oracle
- oracleexecutesql
- oraclesql
- postgres
- postgresdatabaseoverview
- postgresexecutesql
- postgreslistactivequeries
- postgreslistavailableextensions
- postgreslistindexes
- postgreslistinstalledextensions
- postgreslistlocks
- postgreslistschemas
- postgreslistsequences
- postgreslisttables
- postgreslisttriggers
- postgreslistviews
- postgreslongrunningtransactions
- postgresreplicationstats
- postgressql
- redis
- singlestore
- singlestoreexecutesql
- singlestoresql
- spanner
- spannerexecutesql
- spannerlistgraphs
- spannerlisttables
- spannersql
- sqlite
- sqliteexecutesql
- sqlitesql
- tidb
- tidbexecutesql
- tidbsql
- trino
- trinoexecutesql
- trinosql
- utility/wait
- valkey
- yugabytedbsql
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| 51 | + | |
| 52 | + | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| 70 | + | |
| 71 | + | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
| |||
76 | 84 | | |
77 | 85 | | |
78 | 86 | | |
| 87 | + | |
| 88 | + | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
| |||
86 | 96 | | |
87 | 97 | | |
88 | 98 | | |
| 99 | + | |
| 100 | + | |
89 | 101 | | |
90 | 102 | | |
91 | 103 | | |
| |||
96 | 108 | | |
97 | 109 | | |
98 | 110 | | |
| 111 | + | |
| 112 | + | |
99 | 113 | | |
100 | 114 | | |
101 | 115 | | |
| |||
136 | 150 | | |
137 | 151 | | |
138 | 152 | | |
| 153 | + | |
| 154 | + | |
139 | 155 | | |
140 | 156 | | |
141 | 157 | | |
| |||
148 | 164 | | |
149 | 165 | | |
150 | 166 | | |
| 167 | + | |
| 168 | + | |
151 | 169 | | |
152 | 170 | | |
153 | 171 | | |
| |||
598 | 616 | | |
599 | 617 | | |
600 | 618 | | |
| 619 | + | |
| 620 | + | |
601 | 621 | | |
602 | 622 | | |
603 | 623 | | |
| |||
618 | 638 | | |
619 | 639 | | |
620 | 640 | | |
| 641 | + | |
| 642 | + | |
621 | 643 | | |
622 | 644 | | |
623 | 645 | | |
| |||
628 | 650 | | |
629 | 651 | | |
630 | 652 | | |
| 653 | + | |
| 654 | + | |
631 | 655 | | |
632 | 656 | | |
633 | 657 | | |
| |||
647 | 671 | | |
648 | 672 | | |
649 | 673 | | |
| 674 | + | |
| 675 | + | |
650 | 676 | | |
651 | 677 | | |
652 | 678 | | |
| |||
666 | 692 | | |
667 | 693 | | |
668 | 694 | | |
| 695 | + | |
| 696 | + | |
669 | 697 | | |
670 | 698 | | |
671 | 699 | | |
| |||
676 | 704 | | |
677 | 705 | | |
678 | 706 | | |
| 707 | + | |
| 708 | + | |
679 | 709 | | |
680 | 710 | | |
681 | 711 | | |
| |||
693 | 723 | | |
694 | 724 | | |
695 | 725 | | |
| 726 | + | |
| 727 | + | |
696 | 728 | | |
697 | 729 | | |
698 | 730 | | |
| |||
710 | 742 | | |
711 | 743 | | |
712 | 744 | | |
| 745 | + | |
| 746 | + | |
713 | 747 | | |
714 | 748 | | |
715 | 749 | | |
| |||
729 | 763 | | |
730 | 764 | | |
731 | 765 | | |
| 766 | + | |
| 767 | + | |
732 | 768 | | |
733 | 769 | | |
734 | 770 | | |
| |||
745 | 781 | | |
746 | 782 | | |
747 | 783 | | |
| 784 | + | |
| 785 | + | |
748 | 786 | | |
749 | 787 | | |
750 | 788 | | |
| |||
764 | 802 | | |
765 | 803 | | |
766 | 804 | | |
| 805 | + | |
| 806 | + | |
767 | 807 | | |
768 | 808 | | |
769 | 809 | | |
| |||
773 | 813 | | |
774 | 814 | | |
775 | 815 | | |
| 816 | + | |
| 817 | + | |
776 | 818 | | |
777 | 819 | | |
778 | 820 | | |
| |||
782 | 824 | | |
783 | 825 | | |
784 | 826 | | |
| 827 | + | |
| 828 | + | |
785 | 829 | | |
786 | 830 | | |
787 | 831 | | |
| |||
791 | 835 | | |
792 | 836 | | |
793 | 837 | | |
| 838 | + | |
| 839 | + | |
794 | 840 | | |
795 | 841 | | |
796 | 842 | | |
| |||
800 | 846 | | |
801 | 847 | | |
802 | 848 | | |
| 849 | + | |
| 850 | + | |
803 | 851 | | |
804 | 852 | | |
805 | 853 | | |
| |||
812 | 860 | | |
813 | 861 | | |
814 | 862 | | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
815 | 866 | | |
816 | 867 | | |
817 | 868 | | |
| |||
824 | 875 | | |
825 | 876 | | |
826 | 877 | | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
827 | 881 | | |
828 | 882 | | |
829 | 883 | | |
| |||
836 | 890 | | |
837 | 891 | | |
838 | 892 | | |
| 893 | + | |
| 894 | + | |
839 | 895 | | |
840 | 896 | | |
841 | 897 | | |
| |||
846 | 902 | | |
847 | 903 | | |
848 | 904 | | |
| 905 | + | |
| 906 | + | |
849 | 907 | | |
850 | 908 | | |
851 | 909 | | |
| |||
855 | 913 | | |
856 | 914 | | |
857 | 915 | | |
| 916 | + | |
| 917 | + | |
858 | 918 | | |
859 | 919 | | |
860 | 920 | | |
| |||
864 | 924 | | |
865 | 925 | | |
866 | 926 | | |
| 927 | + | |
| 928 | + | |
867 | 929 | | |
868 | 930 | | |
869 | 931 | | |
| |||
873 | 935 | | |
874 | 936 | | |
875 | 937 | | |
| 938 | + | |
| 939 | + | |
876 | 940 | | |
877 | 941 | | |
878 | 942 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
68 | 75 | | |
69 | | - | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
68 | 75 | | |
69 | | - | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
0 commit comments