-
Notifications
You must be signed in to change notification settings - Fork 311
Add MCP tool annotations for better AI understanding #203
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?
Conversation
Add ToolAnnotations to both MCP tools: - interactive_feedback: readOnlyHint=False (creates temp files), destructiveHint=False - get_system_info: readOnlyHint=True (only reads system state), destructiveHint=False These annotations help AI assistants understand tool behavior and make better decisions about when and how to use them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
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 integrates Model Context Protocol (MCP) tool annotations into existing tools, specifically 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 adds MCP tool annotations to interactive_feedback and get_system_info tools, which is a great step towards improving how AI assistants understand and use these tools. The changes are correct and align with the MCP specification. I've suggested a couple of enhancements to further improve the annotations by adding a description field, which will provide even more context to the AI. Overall, this is a good improvement.
| annotations=ToolAnnotations( | ||
| title="Interactive Feedback", | ||
| readOnlyHint=False, # Creates temporary files for feedback storage | ||
| destructiveHint=False, # Does not modify or delete user data | ||
| ) |
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.
To further enhance the tool's discoverability and provide more context to AI assistants, consider adding a description to the ToolAnnotations. The MCP specification includes this field for a more detailed explanation of the tool's purpose. A good description could be the first sentence of the function's docstring: "Interactive feedback collection tool for LLM agents."
annotations=ToolAnnotations(
title="Interactive Feedback",
description="Interactive feedback collection tool for LLM agents.",
readOnlyHint=False, # Creates temporary files for feedback storage
destructiveHint=False, # Does not modify or delete user data
)| annotations=ToolAnnotations( | ||
| title="Get System Info", | ||
| readOnlyHint=True, # Only reads system environment information | ||
| destructiveHint=False, | ||
| ) |
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.
Similar to the other tool, adding a description to the ToolAnnotations here would be beneficial. This provides more information to the AI assistant about what the tool does. The summary from the function's docstring, "獲取系統環境資訊", would be a great choice for the description.
annotations=ToolAnnotations(
title="Get System Info",
description="獲取系統環境資訊",
readOnlyHint=True, # Only reads system environment information
destructiveHint=False,
)|
Thank you for the review! However, I believe there may be a misunderstanding about the MCP specification. The
Tool descriptions are provided separately via:
Both tools in this PR already have proper descriptions via their docstrings, which are exposed in the The PR implements annotations correctly per the MCP specification. No changes needed for the suggested |
Summary
Add MCP tool annotations to help AI assistants understand tool capabilities and behavior.
Changes:
interactive_feedback:readOnlyHint=False(creates temp files for feedback storage),destructiveHint=Falseget_system_info:readOnlyHint=True(only reads system environment),destructiveHint=FalseWhy this matters
MCP Tool Annotations provide hints to AI assistants about tool behavior:
readOnlyHint: Indicates whether the tool modifies statedestructiveHint: Indicates whether the tool makes irreversible changesThese annotations help AI assistants make better decisions about:
Test plan
🤖 Generated with Claude Code