mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-10 07:58:12 -05:00
## 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>