Skip to content

Conversation

@triepod-ai
Copy link

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=False
  • get_system_info: readOnlyHint=True (only reads system environment), destructiveHint=False

Why this matters

MCP Tool Annotations provide hints to AI assistants about tool behavior:

  • readOnlyHint: Indicates whether the tool modifies state
  • destructiveHint: Indicates whether the tool makes irreversible changes

These annotations help AI assistants make better decisions about:

  • Whether to confirm before executing a tool
  • Risk assessment for tool execution
  • Grouping similar operations

Test plan

  • Verify both tools still function correctly
  • Confirm annotations are visible in MCP inspector

🤖 Generated with Claude Code

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]>
@gemini-code-assist
Copy link

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 integrates Model Context Protocol (MCP) tool annotations into existing tools, specifically interactive_feedback and get_system_info. By providing readOnlyHint and destructiveHint values, the changes aim to give AI assistants clearer signals about each tool's operational impact, enabling more informed decisions regarding tool execution, user confirmation, and risk assessment.

Highlights

  • MCP Tool Annotations: Introduced Model Context Protocol (MCP) tool annotations to enhance AI assistant understanding of tool capabilities and behavior.
  • Interactive Feedback Tool: Configured the interactive_feedback tool with readOnlyHint=False and destructiveHint=False to accurately reflect its creation of temporary files for feedback storage.
  • Get System Info Tool: Configured the get_system_info tool with readOnlyHint=True and destructiveHint=False to indicate its read-only nature, as it only retrieves system environment information.

🧠 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

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

Comment on lines +430 to +434
annotations=ToolAnnotations(
title="Interactive Feedback",
readOnlyHint=False, # Creates temporary files for feedback storage
destructiveHint=False, # Does not modify or delete user data
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
    )

Comment on lines +569 to +573
annotations=ToolAnnotations(
title="Get System Info",
readOnlyHint=True, # Only reads system environment information
destructiveHint=False,
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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,
    )

@triepod-ai
Copy link
Author

Thank you for the review! However, I believe there may be a misunderstanding about the MCP specification.

The ToolAnnotations class in the MCP Python SDK (mcp.types.ToolAnnotations) does not include a description field. According to the official MCP Python SDK source, ToolAnnotations only supports:

  • title (string)
  • readOnlyHint (boolean)
  • destructiveHint (boolean)
  • idempotentHint (boolean)
  • openWorldHint (boolean)

Tool descriptions are provided separately via:

  1. The function's docstring (which FastMCP automatically uses)
  2. The description parameter in the @mcp.tool() decorator

Both tools in this PR already have proper descriptions via their docstrings, which are exposed in the tools/list response at the tool level (not within annotations).

The PR implements annotations correctly per the MCP specification. No changes needed for the suggested description additions since that field doesn't exist in ToolAnnotations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants