Skip to content

Conversation

@triepod-ai
Copy link

@triepod-ai triepod-ai commented Dec 28, 2025

Summary

Add ToolAnnotations to 47 MCP tools across Gmail, Google Docs, and Google Drive modules.

Changes by Module

Module Tools Read-Only Additive Modify/Update Delete
gmail_tools.py 15 8 3 2 2
docs_tools.py 14 5 3 6 0
drive_tools.py 14 7 3 3 1
Other modules 4 4 0 0 0
Total 47 24 9 11 3

Annotation Types

  • title: Human-readable names for better LLM understanding
  • readOnlyHint=True: Query/fetch operations (search, get, list)
  • destructiveHint=False: Create operations (create_doc, send_email, share_file)
  • destructiveHint=True: Modify/update/delete operations

destructiveHint Semantics

Following the official MCP filesystem server pattern:

  • write_file, edit_filedestructiveHint=true (modifies existing content)
  • create_directorydestructiveHint=false (purely additive)

Additive operations (destructiveHint=False):

  • Create new documents, emails, files
  • Share/grant permissions (adds without modifying)

Modify operations (destructiveHint=True):

  • Modify doc text, find/replace, insert elements
  • Update drive files, permissions
  • Modify message labels

Delete operations (destructiveHint=True):

  • Remove permissions, delete filters/labels

Why This Matters

Tool annotations help MCP clients make safer, more informed decisions:

  • Read-only tools can be auto-approved for faster workflows
  • Additive tools get appropriate handling without unnecessary warnings
  • Modify/Delete tools trigger confirmation prompts

Test Plan

  • Verify server imports successfully
  • Check annotations appear in tools/list response
  • Test with Claude Desktop or compatible MCP client

🤖 Generated with Claude Code

web-flow and others added 2 commits December 28, 2025 09:50
Add ToolAnnotations to 47 tools across Gmail, Docs, and Drive modules:
- gmail_tools.py: 15 tools (8 readOnly, 7 destructive)
- docs_tools.py: 14 tools (5 readOnly, 9 destructive)
- drive_tools.py: 14 tools (7 readOnly, 7 destructive)
- Partial coverage for remaining modules

Annotations include:
- `title`: Human-readable tool names
- `readOnlyHint`: For query/fetch operations
- `destructiveHint`: For create/update/delete operations

This enables LLMs to make safer, more informed decisions about
tool usage - read-only tools can be auto-approved while destructive
tools trigger confirmation prompts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Changed to destructiveHint=False (additive/modify operations):
- gdocs: Create Doc, Modify Doc Text, Insert Doc Elements, etc. (9 tools)
- gdrive: Create/Update/Share Drive File, etc. (6 tools)
- gmail: Send/Draft Gmail, Create Filter, Modify Labels (5 tools)
- gsheets: Create Sheet
- gslides: Create Presentation

Kept destructiveHint=True (actually destructive):
- gdrive: Remove Drive Permission
- gmail: Manage Gmail Label (can delete), Delete Gmail Filter

Per MCP spec: destructiveHint should only be true for operations
that DELETE or DESTROY data, not for create/update/share operations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@triepod-ai
Copy link
Author

Fix: Corrected destructiveHint Semantics

Updated annotations to properly distinguish between additive and destructive operations per the MCP spec.

Changed to destructiveHint=False (22 tools)

Docs: Create Doc, Modify Doc Text, Find and Replace, Insert Elements, Insert Image, Update Headers/Footers, Batch Update, Create Table, Export to PDF

Drive: Create/Update/Share Drive File, Batch Share, Update Permission, Transfer Ownership

Gmail: Send/Draft Message, Create Filter, Modify/Batch Modify Labels

Sheets: Create Sheet

Slides: Create Presentation

Kept destructiveHint=True (3 tools)

  • Remove Drive Permission - actually removes access
  • Manage Gmail Label - can delete labels
  • Delete Gmail Filter - deletes filter

Rationale

Per MCP spec: destructiveHint means the tool may DELETE or DESTROY data, not just "writes data". Create, update, and share operations are additive—they don't destroy existing data.

@taylorwilsdon
Copy link
Owner

taylorwilsdon commented Dec 31, 2025

There is a comment about how doc mutation functions shouldn’t be marked as descriptive which is an interesting one but your PR description seems to conflict with your own assertion there -

destructiveHint: Create/update/delete operations

Which matches up with how I view it. Appreciate the PR I will give it a full review and make sure we get the other tools up to snuff as well!

@triepod-ai
Copy link
Author

You're right - I checked the official MCP filesystem server for guidance:

  • write_file, edit_filedestructiveHint=true (modifies existing content)
  • create_directorydestructiveHint=false (purely additive)

So the distinction is "creates new things vs modifies existing content."

I'll push a fix that:

  • Keeps destructiveHint=false for pure create operations (create_doc, send_email)
  • Changes to destructiveHint=true for modify/update operations

Thanks for pushing back - it led to a better understanding of the spec!

Per official MCP filesystem server pattern:
- write_file, edit_file have destructiveHint=true
- create_directory has destructiveHint=false

Updated 11 modify/update tools to destructiveHint=true:
- Docs: modify_doc_text, find_and_replace, insert_*, update_headers, batch_update
- Drive: update_file, update_permission, transfer_ownership
- Gmail: modify_labels, batch_modify_labels

Pure create operations remain destructiveHint=false:
- create_doc, send_email, create_filter, share_file, etc.
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.

3 participants